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
1486           $post_states['private'] = __('Private');
1487      if ( 'draft' == $post->post_status && 'draft' != $post_status )
1488           $post_states['draft'] = __('Draft');
1489      if ( 'pending' == $post->post_status && 'pending' != $post_status )
1490           /* translators: post state */
1491           $post_states['pending'] = _x('Pending', 'post state');
1492      if ( is_sticky($post->ID) )
1493           $post_states['sticky'] = __('Sticky');
1494
1495      $post_states = apply_filters( 'display_post_states', $post_states, $post );
1496
1497      if ( ! empty($post_states) ) {
1498           $state_count = count($post_states);
1499           $i = 0;
1500           echo ' - ';
1501           foreach ( $post_states as $state ) {
1502                ++$i;
1503                ( $i == $state_count ) ? $sep = '' : $sep = ', ';
1504                echo "<span class='post-state'>$state$sep</span>";