| 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; |
| | 80 | |
| | 81 | global $wp_post_statuses, $allowed_post_status; |
| | 82 | |
| | 83 | foreach($wp_post_statuses as $key => $wp_post_status){ |
| | 84 | if($key == $post->post_status && $wp_post_status->show_in_admin_status_list){ |
| | 85 | $allowed_post_status = true; |
| | 86 | |
| | 87 | switch ( $post->post_status ) { |
| | 88 | case 'private': |
| | 89 | _e('Privately Published'); |
| | 90 | break; |
| | 91 | case 'publish': |
| | 92 | _e('Published'); |
| | 93 | break; |
| | 94 | case 'future': |
| | 95 | _e('Scheduled'); |
| | 96 | break; |
| | 97 | case 'pending': |
| | 98 | _e('Pending Review'); |
| | 99 | break; |
| | 100 | case 'draft': |
| | 101 | case 'auto-draft': |
| | 102 | _e('Draft'); |
| | 103 | break; |
| | 104 | default: |
| | 105 | _e($wp_post_status->label); |
| | 106 | } |
| | 107 | } |
| | 108 | elseif($key == $post->post_status){ |
| | 109 | _e('Admin Status'); |
| | 110 | $allowed_post_status = false; |
| | 111 | } |
| 106 | | <?php if ( 'publish' == $post->post_status ) : ?> |
| 107 | | <option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option> |
| 108 | | <?php elseif ( 'private' == $post->post_status ) : ?> |
| 109 | | <option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option> |
| 110 | | <?php elseif ( 'future' == $post->post_status ) : ?> |
| 111 | | <option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option> |
| 112 | | <?php endif; ?> |
| 113 | | <option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option> |
| 114 | | <?php if ( 'auto-draft' == $post->post_status ) : ?> |
| 115 | | <option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
| 116 | | <?php else : ?> |
| 117 | | <option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option> |
| 118 | | <?php endif; ?> |
| | 122 | <?php |
| | 123 | foreach($wp_post_statuses as $key => $wp_post_status){ |
| | 124 | if($wp_post_status->show_in_admin_status_list){ |
| | 125 | $selected = $post->post_status === $key ? 'selected' : ''; |
| | 126 | echo "<option ".$selected." value='".$key."'>"; |
| | 127 | switch ( $wp_post_status ) { |
| | 128 | case 'private': |
| | 129 | _e('Privately Published'); |
| | 130 | break; |
| | 131 | case 'publish': |
| | 132 | _e('Published'); |
| | 133 | break; |
| | 134 | case 'future': |
| | 135 | _e('Scheduled'); |
| | 136 | break; |
| | 137 | case 'pending': |
| | 138 | _e('Pending Review'); |
| | 139 | break; |
| | 140 | case 'draft': |
| | 141 | case 'auto-draft': |
| | 142 | _e('Draft'); |
| | 143 | break; |
| | 144 | default: |
| | 145 | _e($wp_post_status->label); |
| | 146 | } |
| | 147 | echo "</option>"; |
| | 148 | } |
| | 149 | } |
| | 150 | ?> |