public_html/wp-content/plugins/wp-statistics/editor.php
/*
	Adds a box to the main column on the Post and Page edit screens.
 */
Adds a box to the main column on the Post and Page edit screens.
Adds a box to the main column on the Post and Page edit screens .
function wp_statistics_add_editor_meta_box() {
	GLOBAL $WP_Statistics;
	$WP_Statistics->load_user_options();
	if( !$WP_Statistics->get_user_option('editor_set') ) {
		$WP_Statistics->update_user_option('editor_set', WP_STATISTICS_VERSION);
		$hidden_widgets = get_user_meta($WP_Statistics->user_id, 'metaboxhidden_post', true);
		if( !is_array( $hidden_widgets ) ) { $hidden_widgets = array(); }
		if( !in_array( 'wp_statistics_editor_meta_box', $hidden_widgets ) ) {
			$hidden_widgets[] = 'wp_statistics_editor_meta_box';
		}
		update_user_meta( $WP_Statistics->user_id, 'metaboxhidden_post', $hidden_widgets );
		$hidden_widgets = get_user_meta($WP_Statistics->user_id, 'metaboxhidden_page', true);
		if( !is_array( $hidden_widgets ) ) { $hidden_widgets = array(); }
		if( !in_array( 'wp_statistics_editor_meta_box', $hidden_widgets ) ) {
			$hidden_widgets[] = 'wp_statistics_editor_meta_box';
		}
		update_user_meta( $WP_Statistics->user_id, 'metaboxhidden_page', $hidden_widgets );
		}
	if (!current_user_can(wp_statistics_validate_capability($WP_Statistics->get_option('read_capability', 'manage_option')))) { return; }
	if ($WP_Statistics->get_option('disable_editor')) { return; }
	$screens = array( 'post', 'page' );
	foreach ( $screens as $screen ) {
		add_meta_box(
			'wp_statistics_editor_meta_box',
			__( 'Hit Statistics', 'wp_statistics' ),
			'wp_statistics_editor_meta_box',
			$screen,
			'normal',
			'high'
			);
		}
	}
function wp_statistics_add_editor_meta_box ( ) { GLOBAL $ WP_Statistics ; $ WP_Statistics -> load_user_options ( ) ; if ( ! $ WP_Statistics -> get_user_option ( 'editor_set' ) ) { $ WP_Statistics -> update_user_option ( 'editor_set' , WP_STATISTICS_VERSION ) ; $ hidden_widgets = get_user_meta ( $ WP_Statistics -> user_id , 'metaboxhidden_post' , true ) ; if ( ! is_array ( $ hidden_widgets ) ) { $ hidden_widgets = array ( ) ; } if ( ! in_array ( 'wp_statistics_editor_meta_box' , $ hidden_widgets ) ) { $ hidden_widgets [ ] = 'wp_statistics_editor_meta_box' ; } update_user_meta ( $ WP_Statistics -> user_id , 'metaboxhidden_post' , $ hidden_widgets ) ; $ hidden_widgets = get_user_meta ( $ WP_Statistics -> user_id , 'metaboxhidden_page' , true ) ; if ( ! is_array ( $ hidden_widgets ) ) { $ hidden_widgets = array ( ) ; } if ( ! in_array ( 'wp_statistics_editor_meta_box' , $ hidden_widgets ) ) { $ hidden_widgets [ ] = 'wp_statistics_editor_meta_box' ; } update_user_meta ( $ WP_Statistics -> user_id , 'metaboxhidden_page' , $ hidden_widgets ) ; } if ( ! current_user_can ( wp_statistics_validate_capability ( $ WP_Statistics -> get_option ( 'read_capability' , 'manage_option' ) ) ) ) { return ; } if ( $ WP_Statistics -> get_option ( 'disable_editor' ) ) { return ; } $ screens = array ( 'post' , 'page' ) ; foreach ( $ screens as $ screen ) { add_meta_box ( 'wp_statistics_editor_meta_box' , __ ( 'Hit Statistics' , 'wp_statistics' ) , 'wp_statistics_editor_meta_box' , $ screen , 'normal' , 'high' ) ; } }
Adds a box to the main column on the Post and Page edit screens.
Adds a box to the main column on the Post and Page edit screens .
// We need to fudge the display settings for first time users so not all of the widgets are displayed, we only want to do this on // the first time they visit the dashboard though so check to see if we've been here before. // If the user does not have at least read access to the status plugin, just return without adding the widgets. // If the admin has disabled the widgets don't display them.