WordPress.org

Make WordPress Core

Ticket #15421: display-post-states.diff

File display-post-states.diff, 1.3 KB (added by greenshady, 3 years ago)

Give specific array keys to post states array

  • wp-admin/includes/template.php

     
    15981598                $post_status = ''; 
    15991599 
    16001600        if ( !empty($post->post_password) ) 
    1601                 $post_states[] = __('Password protected'); 
     1601                $post_states['protected'] = __('Password protected'); 
    16021602        if ( 'private' == $post->post_status && 'private' != $post_status ) 
    1603                 $post_states[] = __('Private'); 
     1603                $post_states['private'] = __('Private'); 
    16041604        if ( 'draft' == $post->post_status && 'draft' != $post_status ) 
    1605                 $post_states[] = __('Draft'); 
     1605                $post_states['draft'] = __('Draft'); 
    16061606        if ( 'pending' == $post->post_status && 'pending' != $post_status ) 
    16071607                /* translators: post state */ 
    1608                 $post_states[] = _x('Pending', 'post state'); 
     1608                $post_states['pending'] = _x('Pending', 'post state'); 
    16091609        if ( is_sticky($post->ID) ) 
    1610                 $post_states[] = __('Sticky'); 
     1610                $post_states['sticky'] = __('Sticky'); 
    16111611        if ( get_post_format( $post->ID ) ) 
    1612                 $post_states[] = '<span>[</span>' . get_post_format_string( get_post_format( $post->ID ) ) . '<span>]</span>'; 
     1612                $post_states['post_format'] = '<span>[</span>' . get_post_format_string( get_post_format( $post->ID ) ) . '<span>]</span>'; 
    16131613 
    16141614        $post_states = apply_filters( 'display_post_states', $post_states ); 
    16151615