display_post_states

Filters the default post display states used in the posts list table.

Description

apply_filters( 'display_post_states', (array) $post_states, (WP_Post) $post ); 

Parameters (2)

0. $post_states (array)
An array of post display states.
1. $post (WP_Post)
The current post object.

Usage

To run the hook, copy the example below.
  1. $post_states = apply_filters( 'display_post_states', $post_states, $post ); 
  2.  
  3. if ( !empty( $post_states ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the display_post_states callback 
  2. function filter_display_post_states( $post_states, $post ) { 
  3. // make filter magic happen here... 
  4. return $post_states
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'display_post_states', 'filter_display_post_states', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'display_post_states', 'filter_display_post_states', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/template.php  
  1. $post_states = apply_filters( 'display_post_states', $post_states, $post );