Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: display_post_states

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
2353       * @since 3.6.0 Added the `$post` parameter.
2354       * @since 5.5.0 Also applied in the Customizer context. If any admin functions
2355       *              are used within the filter, their existence should be checked
2356       *              with `function_exists()` before being used.
2357       *
2358       * @param array<string, string>  $post_states A mapping of post state slugs to translated post state labels.
2359       *                                            E.g. `array( 'draft' => __( 'Draft' ), 'sticky' => __( 'Sticky' ), ... )`.
2360       * @param WP_Post                $post        The current post object.
2361       */
2362      return apply_filters( 'display_post_states', $post_states, $post );
2363 }
2364
2365 /**
2366  * Outputs the attachment media states as HTML.
2367  *
2368  * @since 3.2.0
2369  * @since 5.6.0 Added the `$display` parameter and a return value.
2370  *
2371  * @param WP_Post $post    The attachment post to retrieve states for.