Ticket #18860: 18860.diff
| File 18860.diff, 6.8 KB (added by scribu, 20 months ago) |
|---|
-
wp-admin/edit-form-advanced.php
diff --git wp-admin/edit-form-advanced.php wp-admin/edit-form-advanced.php index 991a029..9762c2e 100644
$post_type_object = get_post_type_object($post_type); 99 99 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). 100 100 require_once('./includes/meta-boxes.php'); 101 101 102 if ( post_type_supports( $post_type, 'title' ) ) { 103 add_action( 'before_post_meta_boxes', 'post_title_meta_box', 10 ); 104 } 105 106 if ( post_type_supports( $post_type, 'editor' ) ) { 107 add_action( 'before_post_meta_boxes', 'post_editor_meta_box', 12 ); 108 } 109 102 110 add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', $post_type, 'side', 'core'); 103 111 104 112 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) ) … … do_action('do_meta_boxes', $post_type, 'side', $post); 160 168 161 169 $current_screen->add_option('layout_columns', array('max' => 2, 'default' => 2) ); 162 170 163 $current_screen->add_option_context( 171 $current_screen->add_option_context( 164 172 '<p>test</p>' 165 173 ); 166 174 … … if ( 1 != $screen_layout_columns ) { 273 281 274 282 <div id="post-body"> 275 283 <div id="post-body-content"> 276 <?php if ( post_type_supports($post_type, 'title') ) { ?>277 <div id="titlediv">278 <div id="titlewrap">279 <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>280 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />281 </div>282 <div class="inside">283 <?php284 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';285 $shortlink = wp_get_shortlink($post->ID, 'post');286 if ( !empty($shortlink) )287 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';288 289 if ( $post_type_object->public && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>290 <div id="edit-slug-box">291 <?php292 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )293 echo $sample_permalink_html;294 ?>295 </div>296 <?php297 }298 ?>299 </div>300 <?php301 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );302 ?>303 </div>304 <?php } ?>305 306 <?php if ( post_type_supports($post_type, 'editor') ) { ?>307 <div id="postdivrich" class="postarea">308 309 <?php wp_editor($post->post_content, 'content', array('dfw' => true) ); ?>310 311 <table id="post-status-info" cellspacing="0"><tbody><tr>312 <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>313 <td class="autosave-info">314 <span class="autosave-message"> </span>315 284 <?php 316 if ( 'auto-draft' != $post->post_status ) { 317 echo '<span id="last-edit">'; 318 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 319 $last_user = get_userdata($last_id); 320 printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); 321 } else { 322 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); 323 } 324 echo '</span>'; 325 } ?> 326 </td> 327 </tr></tbody></table> 328 329 </div> 330 331 <?php 332 } 285 do_action( 'before_post_meta_boxes', $post ); 333 286 334 287 if ( 1 == $screen_layout_columns ) { 335 288 ('page' == $post_type) ? do_action('submitpage_box') : do_action('submitpost_box'); -
wp-admin/includes/meta-boxes.php
diff --git wp-admin/includes/meta-boxes.php wp-admin/includes/meta-boxes.php index ddb3e9d..1ce25e2 100644
3 3 // -- Post related Meta Boxes 4 4 5 5 /** 6 * Display post title elements. 7 * 8 * @since 3.4.0 9 * 10 * @param object $post 11 */ 12 function post_title_meta_box( $post ) { 13 global $post_type_object; 14 15 ?> 16 <div id="titlediv"> 17 <div id="titlewrap"> 18 <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 19 <input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" /> 20 </div> 21 <div class="inside"> 22 <?php 23 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : ''; 24 $shortlink = wp_get_shortlink($post->ID, 'post'); 25 if ( !empty($shortlink) ) 26 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 27 28 if ( $post_type_object->public && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 29 <div id="edit-slug-box"> 30 <?php 31 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status ) 32 echo $sample_permalink_html; 33 ?> 34 </div> 35 <?php 36 } 37 ?> 38 </div> 39 <?php 40 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); 41 ?> 42 </div> 43 <?php 44 } 45 46 47 /** 48 * Display post editor. 49 * 50 * @since 3.4.0 51 * 52 * @param object $post 53 */ 54 function post_editor_meta_box( $post ) { 55 ?> 56 <div id="postdivrich" class="postarea"> 57 58 <?php wp_editor($post->post_content, 'content', array('dfw' => true) ); ?> 59 60 <table id="post-status-info" cellspacing="0"><tbody><tr> 61 <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td> 62 <td class="autosave-info"> 63 <span class="autosave-message"> </span> 64 <?php 65 if ( 'auto-draft' != $post->post_status ) { 66 echo '<span id="last-edit">'; 67 if ( $last_id = get_post_meta($post->ID, '_edit_last', true) ) { 68 $last_user = get_userdata($last_id); 69 printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); 70 } else { 71 printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified)); 72 } 73 echo '</span>'; 74 } ?> 75 </td> 76 </tr></tbody></table> 77 78 </div> 79 <?php 80 } 81 82 83 /** 6 84 * Display post submit form fields. 7 85 * 8 86 * @since 2.7.0 … … if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 233 311 <?php 234 312 } 235 313 314 236 315 /** 237 316 * Display post format form elements. 238 317 *
