display_post_states
Filters the default post display states used in the posts list table.
Description
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.
- $post_states = apply_filters( 'display_post_states', $post_states, $post );
- if ( !empty( $post_states ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the display_post_states callback
- function filter_display_post_states( $post_states, $post ) {
- // make filter magic happen here...
- return $post_states;
- };
- // add the filter
- add_filter( 'display_post_states', 'filter_display_post_states', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- $post_states = apply_filters( 'display_post_states', $post_states, $post );