Changeset 24790 for trunk/wp-admin/edit-form-advanced.php
- Timestamp:
- 07/24/2013 06:08:14 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r24787 r24790 110 110 require_once('./includes/meta-boxes.php'); 111 111 112 113 $publish_callback_args = null; 114 if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) { 115 $revisions = wp_get_post_revisions( $post_ID ); 116 117 // Check if the revisions have been upgraded 118 if ( ! empty( $revisions ) && _wp_get_post_revision_version( end( $revisions ) ) < 1 ) 119 _wp_upgrade_revisions_of_post( $post, $revisions ); 120 121 // We should aim to show the revisions metabox only when there are revisions. 122 if ( count( $revisions ) > 1 ) { 123 reset( $revisions ); // Reset pointer for key() 124 $publish_callback_args = array( 'revisions_count' => count( $revisions ), 'revision_id' => key( $revisions ) ); 125 // add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core'); 126 } 127 } 128 112 129 if ( 'attachment' == $post_type ) { 113 130 wp_enqueue_script( 'image-edit' ); … … 116 133 add_action( 'edit_form_after_title', 'edit_form_image_editor' ); 117 134 } else { 118 add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' );135 add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args ); 119 136 } 120 137 … … 171 188 if ( is_super_admin() || current_user_can( $post_type_object->cap->edit_others_posts ) ) 172 189 add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); 173 }174 175 if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) {176 $revisions = wp_get_post_revisions( $post_ID );177 178 // Check if the revisions have been upgraded179 if ( ! empty( $revisions ) && _wp_get_post_revision_version( end( $revisions ) ) < 1 )180 _wp_upgrade_revisions_of_post( $post, $revisions );181 182 // We should aim to show the revisions metabox only when there are revisions.183 if ( count( $revisions ) > 1 )184 add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');185 190 } 186 191
Note: See TracChangeset
for help on using the changeset viewer.