Title: display_post_states
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘display_post_states’, array<string, , WP_Post $post )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#wp--skip-link--target)

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

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#parameters)󠁿

string> $post_states A mapping of post state slugs to translated post state labels.

E.g. `array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... )`.

`$post`[WP_Post](https://developer.wordpress.org/reference/classes/wp_post/)

The current post object.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'display_post_states', $post_states, $post );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/template.php#L2368)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/template.php#L2368-L2368)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#related)󠁿

| Used by | Description | 
| [get_post_states()](https://developer.wordpress.org/reference/functions/get_post_states/)`wp-admin/includes/template.php` |

Retrieves an array of post states from a post.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.5.0](https://developer.wordpress.org/reference/since/5.5.0/) | Also applied in the Customizer context. If any admin functions are used within the filter, their existence should be checked with `function_exists()` before being used. | 
| [3.6.0](https://developer.wordpress.org/reference/since/3.6.0/) | Added the `$post` parameter. | 
| [2.8.0](https://developer.wordpress.org/reference/since/2.8.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 3 content](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#comment-content-3430)
 2.    [Pixelbart](https://profiles.wordpress.org/pixelbart/)  [  7 years ago  ](https://developer.wordpress.org/reference/hooks/display_post_states/#comment-3430)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F%23comment-3430)
     Vote results for this note: 1[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F%23comment-3430)
 4.  This always shows the current post status in the labels. This is especially useful
     when adding many custom post states.
 5.      ```php
         /**
          * This always shows the current post status in the labels.
          *
          * @param array   $states current states.
          * @param WP_Post $post current post object.
          * @return array
          */
         function custom_display_post_states( $states, $post ) {
         	/* Receive the post status object by post status name */
         	$post_status_object = get_post_status_object( $post->post_status );
     
         	/* Checks if the label exists */
         	if ( in_array( $post_status_object->label, $states, true ) ) {
         		return $states;
         	}
     
         	/* Adds the label of the current post status */
         	$states[ $post_status_object->name ] = $post_status_object->label;
     
         	return $states;
         }
     
         add_filter( 'display_post_states', 'custom_display_post_states', 10, 2 );
         ```
     
 6.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F%3Freplytocom%3D3430%23feedback-editor-3430)
 7.   [Skip to note 4 content](https://developer.wordpress.org/reference/hooks/display_post_states/?output_format=md#comment-content-858)
 8.    [brohde](https://profiles.wordpress.org/brohde/)  [  11 years ago  ](https://developer.wordpress.org/reference/hooks/display_post_states/#comment-858)
 9.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F%23comment-858)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F%23comment-858)
 10. Second parameter ($post) is type [WP_Post](https://developer.wordpress.org/reference/classes/wp_post/),
     not int.
 11.  * Hi, nice find! Would you like to [open a core trac ticket](https://core.trac.wordpress.org/newticket)
        and submit a patch to fix this discrepancy?
      * [Drew Jaynes](https://profiles.wordpress.org/drewapicture/) [11 years ago](https://developer.wordpress.org/reference/hooks/display_post_states/#comment-859)
 12.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F%3Freplytocom%3D858%23feedback-editor-858)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fdisplay_post_states%2F)
before being able to contribute a note or feedback.