Changeset 21948 for trunk/wp-admin/edit-form-advanced.php
- Timestamp:
- 09/21/2012 10:52:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r21944 r21948 64 64 10 => sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ), 65 65 ); 66 $messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated' ) ); // Hack, for now. 66 67 67 68 $messages = apply_filters( 'post_updated_messages', $messages ); … … 78 79 $notice = false; 79 80 $form_extra = ''; 80 if ( 'auto-draft' == $post->post_status) {81 if ( 'auto-draft' == get_post_status( $post ) ) { 81 82 if ( 'edit' == $action ) 82 83 $post->post_title = ''; … … 107 108 require_once('./includes/meta-boxes.php'); 108 109 109 add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', null, 'side', 'core'); 110 if ( 'attachment' == $post_type ) { 111 wp_enqueue_script( 'image-edit' ); 112 wp_enqueue_style( 'imgareaselect' ); 113 add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' ); 114 add_meta_box( 'attachmentdata', __('Attachment Page Content'), 'attachment_data_meta_box', null, 'normal', 'core' ); 115 add_action( 'edit_form_after_title', 'edit_form_image_editor' ); 116 } else { 117 add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' ); 118 } 110 119 111 120 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) … … 113 122 114 123 // all taxonomies 115 foreach ( get_object_taxonomies( $post_type) as $tax_name ) {124 foreach ( get_object_taxonomies( $post ) as $tax_name ) { 116 125 $taxonomy = get_taxonomy($tax_name); 117 126 if ( ! $taxonomy->show_ui ) … … 145 154 add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core'); 146 155 147 if ( ( 'publish' == $post->post_status || 'private' == $post->post_status) && post_type_supports($post_type, 'comments') )156 if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') ) 148 157 add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core'); 149 158 150 if ( ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) )159 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) 151 160 add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); 152 161 … … 270 279 <?php 271 280 } 272 if ( 'draft' != $post->post_status)281 if ( 'draft' != get_post_status( $post ) ) 273 282 wp_original_referer_field(true, 'previous'); 274 283 … … 297 306 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 298 307 299 if ( $post_type_object->public && ! ( 'pending' == $post->post_status&& !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>308 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 300 309 <div id="edit-slug-box"> 301 310 <?php 302 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status)311 if ( $sample_permalink_html && 'auto-draft' != get_post_status( $post ) ) 303 312 echo $sample_permalink_html; 304 313 ?> … … 311 320 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); 312 321 ?> 313 </div> 314 <?php } ?> 315 316 <?php if ( post_type_supports($post_type, 'editor') ) { ?> 322 </div><!-- /titlediv --> 323 <?php 324 } 325 326 do_action( 'edit_form_after_title' ); 327 328 if ( post_type_supports($post_type, 'editor') ) { 329 ?> 317 330 <div id="postdivrich" class="postarea"> 318 331 … … 324 337 <span class="autosave-message"> </span> 325 338 <?php 326 if ( 'auto-draft' != $post->post_status) {339 if ( 'auto-draft' != get_post_status( $post ) ) { 327 340 echo '<span id="last-edit">'; 328 341 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
Note: See TracChangeset
for help on using the changeset viewer.