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
3519           $post_states[] = __('Private');
3520      if ( 'draft' == $post->post_status && 'draft' != $post_status )
3521           $post_states[] = __('Draft');
3522      if ( 'pending' == $post->post_status && 'pending' != $post_status )
3523           /* translators: post state */
3524           $post_states[] = _x('Pending', 'post state');
3525      if ( is_sticky($post->ID) )
3526           $post_states[] = __('Sticky');
3527
3528      $post_states = apply_filters( 'display_post_states', $post_states );
3529
3530      if ( ! empty($post_states) ) {
3531           $state_count = count($post_states);
3532           $i = 0;
3533           echo ' - ';
3534           foreach ( $post_states as $state ) {
3535                ++$i;
3536                ( $i == $state_count ) ? $sep = '' : $sep = ', ';
3537                echo "<span class='post-state'>$state$sep</span>";