apply_filters( 'post_states_html', string $post_states_html, \array<string, , WP_Post $post )
- Since
- 6.9.0
Filters the HTML string of post states.
Compatibility
- WordPress
- since 6.9.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 3 of the 5 tracked releases, added in 6.9.0.
Parameters
$post_states_htmlstring- All relevant post states combined into an HTML string for display.
E.g.— <span class='post-state'>Draft, </span><span class='post-state'>Sticky</span>. \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:2284_post_states()
Source code
* @param string $post_states_html All relevant post states combined into an HTML string for display. * E.g. `— <span class='post-state'>Draft, </span><span class='post-state'>Sticky</span>`. * @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. */ $post_states_html = apply_filters( 'post_states_html', $post_states_html, $post_states, $post ); if ( $display ) { echo $post_states_html; } return $post_states_html;Changelog
Introduced in 6.9.0. Unchanged from 6.9.7 through 7.1.0.
Signature, return type and hooks compared across 3 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 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.