WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 1434 | $post_states['private'] = __('Private'); |
| 1435 | if ( 'draft' == $post->post_status && 'draft' != $post_status ) |
| 1436 | $post_states['draft'] = __('Draft'); |
| 1437 | if ( 'pending' == $post->post_status && 'pending' != $post_status ) |
| 1438 | /* translators: post state */ |
| 1439 | $post_states['pending'] = _x('Pending', 'post state'); |
| 1440 | if ( is_sticky($post->ID) ) |
| 1441 | $post_states['sticky'] = __('Sticky'); |
| 1442 | |
| 1443 | $post_states = apply_filters( 'display_post_states', $post_states ); |
| 1444 | |
| 1445 | if ( ! empty($post_states) ) { |
| 1446 | $state_count = count($post_states); |
| 1447 | $i = 0; |
| 1448 | echo ' - '; |
| 1449 | foreach ( $post_states as $state ) { |
| 1450 | ++$i; |
| 1451 | ( $i == $state_count ) ? $sep = '' : $sep = ', '; |
| 1452 | echo "<span class='post-state'>$state$sep</span>"; |