40 | | <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> |
41 | | <input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" /> |
| 40 | <?php |
| 41 | $btnHideArray = array("publish","future","private"); |
| 42 | |
| 43 | if ( !in_array( $post->post_status, $btnHideArray ) ) |
| 44 | { |
| 45 | $phrase = 'Save '.ucfirst($post->post_status); |
| 46 | echo '<input type="submit" name="save" id="save-post" value="'. __($phrase) .'" class="button" />'; |
| 47 | } |
| 48 | ?> |
80 | | switch ( $post->post_status ) { |
81 | | case 'private': |
82 | | _e('Privately Published'); |
83 | | break; |
84 | | case 'publish': |
85 | | _e('Published'); |
86 | | break; |
87 | | case 'future': |
88 | | _e('Scheduled'); |
89 | | break; |
90 | | case 'pending': |
91 | | _e('Pending Review'); |
92 | | break; |
93 | | case 'draft': |
94 | | case 'auto-draft': |
95 | | _e('Draft'); |
96 | | break; |
97 | | } |
| 83 | global $wp_post_statuses, $allowed_post_status; |
| 84 | |
| 85 | foreach($wp_post_statuses as $key => $wp_post_status){ |
| 86 | if($key == $post->post_status && $wp_post_status->show_in_admin_status_list){ |
| 87 | $allowed_post_status = true; |
| 88 | echo __($wp_post_status->label); |
| 89 | } |
| 90 | elseif($key == $post->post_status){ |
| 91 | $allowed_post_status = false; |
| 92 | echo __($wp_post_status->label); |
| 93 | } |
| 94 | } |
107 | | <?php if ( 'publish' == $post->post_status ) : ?> |
108 | | <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> |
109 | | <?php elseif ( 'private' == $post->post_status ) : ?> |
110 | | <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> |
111 | | <?php elseif ( 'future' == $post->post_status ) : ?> |
112 | | <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> |
113 | | <?php endif; ?> |
114 | | <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> |
115 | | <?php if ( 'auto-draft' == $post->post_status ) : ?> |
116 | | <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
117 | | <?php else : ?> |
118 | | <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
119 | | <?php endif; ?> |
| 104 | <?php |
| 105 | $ppf = array('publish','private','future'); |
| 106 | $ad = array('auto-draft','draft'); |
| 107 | $adSet = false; |
| 108 | |
| 109 | foreach($wp_post_statuses as $key => $wp_post_status){ |
| 110 | $show = false; |
| 111 | if($wp_post_status->show_in_admin_status_list){ |
| 112 | if(in_array($key, $ppf)){ |
| 113 | // Show just one of those |
| 114 | if($post->post_status == $key){ |
| 115 | $show = true; |
| 116 | } |
| 117 | } elseif($key == 'trash'){ |
| 118 | // Don't show |
| 119 | $show = false; |
| 120 | } else{ |
| 121 | $show = true; |
| 122 | } |
| 123 | |
| 124 | if($show){ |
| 125 | echo "<option ".selected( $post->post_status, $key, false )." value='".$key."'>". __($wp_post_status->label) ."</option>"; |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | ?> |