= self::MAX_SNOOZES ) { update_option( self::STOPPED_OPTION, 1 ); } } } public function maybe_show_notice() { if ( ! current_user_can( 'manage_options' ) ) { return; } if ( get_option( self::STOPPED_OPTION ) ) { return; } $dismissed = get_option( self::DISMISSED_OPTION ); if ( $dismissed ) { $days_since_dismiss = ( time() - (int) $dismissed ) / DAY_IN_SECONDS; if ( $days_since_dismiss < self::DAYS_BEFORE_RESHOW ) { return; } } $activated = get_option( self::ACTIVATED_OPTION ); if ( ! $activated ) { return; } $days_active = ( time() - (int) $activated ) / DAY_IN_SECONDS; if ( $days_active < self::DAYS_BEFORE_SHOW ) { return; } $snooze_url = wp_nonce_url( add_query_arg( 'idpeek_dismiss_review', '1' ), 'idpeek_dismiss_review' ); $stop_url = wp_nonce_url( add_query_arg( 'idpeek_stop_review', '1' ), 'idpeek_dismiss_review' ); ?>
base && ! empty( $screen->post_type ) ) { add_filter( "manage_{$screen->post_type}_posts_columns", array( $this, 'add_id_column' ) ); add_action( "manage_{$screen->post_type}_posts_custom_column", array( $this, 'show_post_id_value' ), 10, 2 ); } // Media Library uses its own hook name, separate from other post types. if ( 'upload' === $screen->base ) { add_filter( 'manage_upload_columns', array( $this, 'add_id_column' ) ); add_action( 'manage_media_custom_column', array( $this, 'show_post_id_value' ), 10, 2 ); } // Category, Tag, and any custom taxonomy list screen. if ( 'edit-tags' === $screen->base && ! empty( $screen->taxonomy ) ) { add_filter( "manage_edit-{$screen->taxonomy}_columns", array( $this, 'add_id_column' ) ); add_filter( "manage_{$screen->taxonomy}_custom_column", array( $this, 'show_taxonomy_id_value' ), 10, 3 ); } // Users list screen. if ( 'users' === $screen->base ) { add_filter( 'manage_users_columns', array( $this, 'add_id_column' ) ); add_filter( 'manage_users_custom_column', array( $this, 'show_user_id_value' ), 10, 3 ); } // Comments list screen. if ( 'edit-comments' === $screen->base ) { add_filter( 'manage_edit-comments_columns', array( $this, 'add_id_column' ) ); add_action( 'manage_comments_custom_column', array( $this, 'show_comment_id_value' ), 10, 2 ); } } /** * Insert the ID column right after the checkbox column (shared by all list table types). */ public function add_id_column( $columns ) { $new_columns = array(); foreach ( $columns as $key => $label ) { $new_columns[ $key ] = $label; if ( 'cb' === $key ) { $new_columns[ self::COLUMN_KEY ] = __( 'ID', 'idpeek' ); } } if ( ! isset( $new_columns[ self::COLUMN_KEY ] ) ) { $new_columns = array( self::COLUMN_KEY => __( 'ID', 'idpeek' ) ) + $new_columns; } return $new_columns; } public function show_post_id_value( $column, $post_id ) { if ( self::COLUMN_KEY === $column ) { echo esc_html( $post_id ); } } public function show_taxonomy_id_value( $content, $column, $term_id ) { if ( self::COLUMN_KEY === $column ) { $content = esc_html( $term_id ); } return $content; } public function show_user_id_value( $value, $column, $user_id ) { if ( self::COLUMN_KEY === $column ) { return esc_html( $user_id ); } return $value; } public function show_comment_id_value( $column, $comment_id ) { if ( self::COLUMN_KEY === $column ) { echo esc_html( $comment_id ); } } /** * Keep the ID column narrow so it doesn't crowd the title column. * Registered as a proper stylesheet handle with inline CSS attached, * instead of an inline