wphooks.info - display_post_states

display_post_states

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-admin/includes/template.php:
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
	/**
	 * Filters the default post display states used in the posts list table.
	 *
	 * @since 2.8.0
	 * @since 3.6.0 Added the `$post` parameter.
	 *
	 * @param string[] $post_states An array of post display states.
	 * @param WP_Post  $post        The current post object.
	 */
	$post_states = apply_filters( 'display_post_states', $post_states, $post );

	if ( ! empty( $post_states ) ) {
		$state_count = count( $post_states );
		$i           = 0;
		echo ' — ';
		foreach ( $post_states as $state ) {
			++$i;
			( $i == $state_count ) ? $sep = '' : $sep = ', ';
			echo "<span class='post-state'>$state$sep</span>";