apply_filters( 'display_post_states', \array<string, , WP_Post $post )
- Since
- 2.8.0, 3.6.0, 5.5.0
Filters the default post display states used in the posts list table.
Compatibility
- WordPress
- since 5.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
\array<string,- string> $post_states A mapping of post state slugs to translated post state labels.
E.g.array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... ). $postWP_Post- The current post object.
Where this hook fires · 1
wp-admin/includes/template.php:2368get_post_states()
Source code
* with `function_exists()` before being used. * * @param array<string, string> $post_states A mapping of post state slugs to translated post state labels. * E.g. `array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... )`. * @param WP_Post $post The current post object. */ return apply_filters( 'display_post_states', $post_states, $post );} /** * Outputs the attachment media states as HTML. * * @since 3.2.0Changelog
Introduced in 2.8.0. 2 changes between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.9.7
Parameter `` added.verified against source
6.9.7
Parameter
$post_states removed.verified against source5.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.from the docblock3.6.0
Added the
$post parameter.from the docblock2.8.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.0.4 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.