Advertisements

wp_dashboard_recent_comments_control

Definition:
function wp_dashboard_recent_comments_control() {}

The recent comments dashboard widget control.

Source code

function wp_dashboard_recent_comments_control() {

	if ( !$widget_options = get_option( 'dashboard_widget_options' ) )

		$widget_options = array();



	if ( !isset($widget_options['dashboard_recent_comments']) )

		$widget_options['dashboard_recent_comments'] = array();



	if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) {

		$number = absint( $_POST['widget-recent-comments']['items'] );

		$widget_options['dashboard_recent_comments']['items'] = $number;

		update_option( 'dashboard_widget_options', $widget_options );

	}



	$number = isset( $widget_options['dashboard_recent_comments']['items'] ) ? (int) $widget_options['dashboard_recent_comments']['items'] : '';



	echo '<p><label for="comments-number">' . __('Number of comments to show:') . '</label>';

	echo '<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' . $number . '" size="3" /></p>';

}

3553

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: