Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_post_states [ WordPress Function ]

_post_states ( $post )
Defined at:



No description yet.

Source


<?php
function _post_states($post) {
    
$post_states = array();
    if ( isset( 
$_REQUEST['post_status'] ) )
        
$post_status $_REQUEST['post_status'];
    else
        
$post_status '';

    if ( !empty(
$post->post_password) )
        
$post_states['protected'] = __('Password protected');
    if ( 
'private' == $post->post_status && 'private' != $post_status )
        
$post_states['private'] = __('Private');
    if ( 
'draft' == $post->post_status && 'draft' != $post_status )
        
$post_states['draft'] = __('Draft');
    if ( 
'pending' == $post->post_status && 'pending' != $post_status )
        
/* translators: post state */
        
$post_states['pending'] = _x('Pending''post state');
    if ( 
is_sticky($post->ID) )
        
$post_states['sticky'] = __('Sticky');

    
$post_states apply_filters'display_post_states'$post_states );

    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>";
        }
    }

    if ( 
get_post_format$post->ID ) )
        echo 
' - <span class="post-state-format">' get_post_format_stringget_post_format$post->ID ) ) . '</span>';
}
?>

Examples [ wp-snippets.com ]

Top Google Search Results

More ...

User discussions [ wordpress.org ]

0 User Note(s)

None yet. Be the first!

Add New ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics