Ticket #21391: 21391.4.patch
File 21391.4.patch, 22.0 KB (added by , 12 years ago) |
---|
-
wp-includes/link-template.php
106 106 if ( $post->post_type == 'page' ) 107 107 return get_page_link($post->ID, $leavename, $sample); 108 108 elseif ( $post->post_type == 'attachment' ) 109 return get_attachment_link( $post->ID);109 return get_attachment_link( $post->ID, $leavename ); 110 110 elseif ( in_array($post->post_type, get_post_types( array('_builtin' => false) ) ) ) 111 111 return get_post_permalink($post->ID, $leavename, $sample); 112 112 … … 292 292 * @since 2.0.0 293 293 * 294 294 * @param mixed $post Optional. Post ID or object. 295 * @param bool $leavename Optional. Leave name. 295 296 * @return string 296 297 */ 297 function get_attachment_link( $post = null ) {298 function get_attachment_link( $post = null, $leavename = false ) { 298 299 global $wp_rewrite; 299 300 300 301 $link = false; … … 314 315 $name = $post->post_name; 315 316 316 317 if ( strpos($parentlink, '?') === false ) 317 $link = user_trailingslashit( trailingslashit($parentlink) . $name ); 318 $link = user_trailingslashit( trailingslashit($parentlink) . '%postname%' ); 319 320 if ( ! $leavename ) 321 $link = str_replace( '%postname%', $name, $link ); 318 322 } 319 323 320 324 if ( ! $link ) -
wp-includes/post.php
53 53 register_post_type( 'attachment', array( 54 54 'labels' => array( 55 55 'name' => __( 'Media' ), 56 'edit_item' => __( 'Edit Media' ), 56 'name' => _x('Media', 'post type general name'), 57 'singular_name' => _x( 'Media Item', 'post type singular name' ), 58 'add_new' => _x( 'Add New', 'media item'), 59 'add_new_item' => __( 'Add New Media' ), 60 'edit_item' => __( 'Edit Media' ), 61 'new_item' => __( 'New Media Item' ), 62 'view_item' => __( 'View Attachment Page' ), 63 'search_items' => __( 'Search Media' ), 64 'not_found' => __( 'No media found.' ), 65 'not_found_in_trash' => __('No media found in Trash.'), 66 'parent_item_colon' => __('Parent:'), 67 'all_items' => __( 'All Media' ), 57 68 ), 58 69 'public' => true, 59 'show_ui' => false,70 'show_ui' => true, 60 71 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 61 '_edit_link' => ' media.php?attachment_id=%d', /* internal use only. don't use this when registering your own post type. */72 '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ 62 73 'capability_type' => 'post', 63 74 'map_meta_cap' => true, 64 75 'hierarchical' => false, … … 66 77 'query_var' => false, 67 78 'show_in_nav_menus' => false, 68 79 'delete_with_user' => true, 69 'supports' => array( 'comments', 'author' ), 80 'supports' => array( 'title', 'editor', 'author', 'comments', 'image_editor' ), 81 'disables' => array( 'save', 'preview', 'post_status', 'visibility' ) 70 82 ) ); 71 83 72 84 register_post_type( 'revision', array( … … 1153 1165 add_post_type_support($post_type, array('title', 'editor')); 1154 1166 } 1155 1167 1168 if ( ! empty( $args->disables ) ) { 1169 disable_for_post_type( $post_type, $args->disables ); 1170 unset( $args->disables ); 1171 } 1172 1156 1173 if ( false !== $args->query_var && !empty($wp) ) { 1157 1174 if ( true === $args->query_var ) 1158 1175 $args->query_var = $post_type; … … 1508 1525 1509 1526 return true; 1510 1527 } 1528 /** 1529 * Disable long-existing features for a post type 1530 * 1531 * Can't later add post type support for certain things 1532 * 1533 * @since 3.5.0 1534 * @param string $post_type The post type for which to remove the feature 1535 * @param string|array $feature the feature being removed, can be an array of feature strings or a single string 1536 */ 1537 function disable_for_post_type( $post_type, $feature ) { 1538 global $_wp_post_type_disabled; 1511 1539 1540 $features = (array) $feature; 1541 foreach ($features as $feature) { 1542 if ( func_num_args() == 2 ) 1543 $_wp_post_type_disabled[$post_type][$feature] = true; 1544 else 1545 $_wp_post_type_disabled[$post_type][$feature] = array_slice( func_get_args(), 2 ); 1546 } 1547 } 1548 1512 1549 /** 1550 * Get all the disabled post type features 1551 * 1552 * @since 3.5.0 1553 * @param string $post_type The post type 1554 * @return array 1555 */ 1556 1557 function get_all_disabled_for_post_type( $post_type ) { 1558 global $_wp_post_type_disabled; 1559 1560 if ( isset( $_wp_post_type_disabled[$post_type] ) ) 1561 return $_wp_post_type_disabled[$post_type]; 1562 1563 return array(); 1564 } 1565 1566 /** 1567 * Checks whether a post type disables a given feature 1568 * 1569 * @since 3.5.0 1570 * @param string $post_type The post type being checked 1571 * @param string $feature the feature being checked 1572 * @return boolean 1573 */ 1574 1575 function post_type_disables( $post_type, $feature ) { 1576 global $_wp_post_type_disabled; 1577 1578 if ( !isset( $_wp_post_type_disabled[$post_type][$feature] ) ) 1579 return false; 1580 1581 // If no args passed then no extra checks need be performed 1582 if ( func_num_args() <= 2 ) 1583 return true; 1584 1585 return true; 1586 } 1587 1588 /** 1513 1589 * Updates the post type for the post ID. 1514 1590 * 1515 1591 * The page or post cache will be cleaned for the post ID. -
wp-admin/includes/post.php
235 235 } 236 236 } 237 237 238 // Attachment stuff 239 if ( isset( $post_data['_wp_attachment_image_alt'] ) ) { 240 $image_alt = get_post_meta( $post_ID, '_wp_attachment_image_alt', true ); 241 if ( $image_alt != stripslashes( $post_data['_wp_attachment_image_alt'] ) ) { 242 $image_alt = wp_strip_all_tags( stripslashes( $post_data['_wp_attachment_image_alt'] ), true ); 243 // update_meta expects slashed 244 update_post_meta( $post_ID, '_wp_attachment_image_alt', addslashes( $image_alt ) ); 245 } 246 } 247 238 248 add_meta( $post_ID ); 239 249 240 250 update_post_meta( $post_ID, '_edit_last', $GLOBALS['current_user']->ID ); … … 1064 1074 1065 1075 list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); 1066 1076 1067 if ( 'publish' == $post->post_status) {1077 if ( 'publish' == get_post_status( $post ) ) { 1068 1078 $ptype = get_post_type_object($post->post_type); 1069 1079 $view_post = $ptype->labels->view_item; 1070 1080 $title = __('Click to edit this part of the permalink'); -
wp-admin/includes/screen.php
98 98 if ( 'post' == $screen->base ) { 99 99 if ( 'post' == $screen->post_type || 'page' == $screen->post_type ) 100 100 $hidden = array('slugdiv', 'trackbacksdiv', 'postcustom', 'postexcerpt', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv'); 101 elseif ( 'attachment' == $screen->post_type ) 102 $hidden = array( 'slugdiv', 'trackbacksdiv', 'postcustom', 'authordiv', 'revisionsdiv' ); 101 103 else 102 104 $hidden = array( 'slugdiv' ); 103 105 } -
wp-admin/includes/media.php
857 857 858 858 /** 859 859 * Filters input from media_upload_form_handler() and assigns a default 860 * post_title from the file name if none supplied. 860 * post_title from the file name if none supplied. 861 861 * 862 * Illustrates the use of the attachment_fields_to_save filter 862 * Illustrates the use of the attachment_fields_to_save filter 863 863 * which can be used to add default values to any field before saving to DB. 864 864 * 865 865 * @since 2.5.0 … … 2095 2095 echo '<p>' . sprintf( __( 'Sorry, you have used all of your storage quota of %s MB.' ), get_space_allowed() ) . '</p>'; 2096 2096 } 2097 2097 2098 /** 2099 * Displays the image and editor in the post editor 2100 * 2101 * @since 3.5.0 2102 */ 2103 function edit_form_image_editor() { 2104 $post = get_post(); 2105 2106 if ( ( $attachment_id = intval( $post->ID ) ) && $thumb_url = wp_get_attachment_image_src( $attachment_id, 'thumbnail', true ) ) 2107 $thumb_url = $thumb_url[0]; 2108 else 2109 $thumb_url = false; 2110 2111 $filename = esc_html( basename( $post->guid ) ); 2112 $title = esc_attr( $post->post_title ); 2113 2114 2115 $post_mime_types = get_post_mime_types(); 2116 $keys = array_keys( wp_match_mime_types( array_keys( $post_mime_types ), $post->post_mime_type ) ); 2117 $type = array_shift( $keys ); 2118 $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />"; 2119 2120 2121 $media_dims = ''; 2122 $meta = wp_get_attachment_metadata( $post->ID ); 2123 if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) ) 2124 $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']} × {$meta['height']}</span> "; 2125 $media_dims = apply_filters( 'media_meta', $media_dims, $post ); 2126 2127 $image_edit_button = ''; 2128 if ( gd_edit_image_support( $post->post_mime_type ) ) { 2129 $nonce = wp_create_nonce( "image_editor-$post->ID" ); 2130 $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <img src='" . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . "' class='imgedit-wait-spin' alt='' />"; 2131 } 2132 2133 ?> 2134 <div class="wp_attachment_holder"> 2135 <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div> 2136 2137 <div class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>"> 2138 <p><img class="thumbnail" src="<?php echo $thumb_url; ?>" alt="" /></p> 2139 <p><?php echo $image_edit_button; ?></p> 2140 </div> 2141 <div style="display:none" class="image-editor" id="image-editor-<?php echo $attachment_id; ?>"></div> 2142 2143 <div class="wp_attachment_details"> 2144 <p><strong><?php _e( 'File name:' ); ?></strong> <?php echo $filename; ?></p> 2145 <p><strong><?php _e( 'File type:' ); ?></strong> <?php echo $post->post_mime_type; ?></p> 2146 <?php 2147 if ( !empty( $media_dims ) ) 2148 echo '<p><strong>' . __( 'Dimensions:' ) . "</strong> $media_dims</p>"; 2149 ?> 2150 </div> 2151 </div> 2152 <?php 2153 } 2154 2098 2155 add_filter( 'async_upload_image', 'get_media_item', 10, 2 ); 2099 2156 add_filter( 'async_upload_audio', 'get_media_item', 10, 2 ); 2100 2157 add_filter( 'async_upload_video', 'get_media_item', 10, 2 ); -
wp-admin/includes/meta-boxes.php
26 26 </div> 27 27 28 28 <div id="minor-publishing-actions"> 29 <?php if ( ! post_type_disables( $post->post_type, 'save' ) ) : ?> 29 30 <div id="save-action"> 30 31 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?> 31 32 <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" /> … … 34 35 <?php } ?> 35 36 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="draft-ajax-loading" alt="" /> 36 37 </div> 37 <?php if ( $post_type_object->public ) : ?> 38 <?php 39 endif; // doesn't disable save button 40 41 if ( ! post_type_disables( $post->post_type, 'preview' ) && $post_type_object->public ) : 42 ?> 38 43 <div id="preview-action"> 39 44 <?php 40 45 if ( 'publish' == $post->post_status ) { … … 55 60 56 61 <div id="misc-publishing-actions"> 57 62 63 <?php if ( ! post_type_disables( $post->post_type, 'post_status' ) ) : ?> 58 64 <div class="misc-pub-section"><label for="post_status"><?php _e('Status:') ?></label> 65 59 66 <span id="post-status-display"> 60 67 <?php 61 68 switch ( $post->post_status ) { … … 103 110 </div> 104 111 105 112 <?php } ?> 106 </div>< ?php // /misc-pub-section ?>113 </div><!-- /misc-pub-section --> 107 114 115 <?php endif; // doesn't disable post_status ?> 116 117 <?php if ( ! post_type_disables( $post->post_type, 'visibility' ) ) : ?> 108 118 <div class="misc-pub-section" id="visibility"> 109 119 <?php _e('Visibility:'); ?> <span id="post-visibility-display"><?php 110 120 … … 148 158 </div> 149 159 <?php } ?> 150 160 151 </div>< ?php // /misc-pub-section ?>161 </div><!-- /misc-pub-section --> 152 162 163 <?php endif; // doesn't disable visibility ?> 164 153 165 <?php 154 166 // translators: Publish box date format, see http://php.net/date 155 167 $datef = __( 'M j, Y @ G:i' ); 156 168 if ( 0 != $post->ID ) { 157 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 169 if ( 'attachment' == get_post_type() ) { // attachments are uploaded on a date 170 $stamp = __('Uploaded on: <b>%1$s</b>'); 171 } else if ( 'future' == get_post_status() ) { // scheduled for publishing at a future date 158 172 $stamp = __('Scheduled for: <b>%1$s</b>'); 159 } else if ( 'publish' == $post->post_status || 'private' == $post->post_status) { // already published173 } else if ( 'publish' == get_post_status() || 'private' == get_post_status() ) { // already published 160 174 $stamp = __('Published on: <b>%1$s</b>'); 161 175 } else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 162 176 $stamp = __('Publish <b>immediately</b>'); … … 171 185 $date = date_i18n( $datef, strtotime( current_time('mysql') ) ); 172 186 } 173 187 174 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>188 if ( $can_publish && ! post_type_disables( $post->post_type, 'change_publish_date' ) ) : // Contributors don't get to choose the date of publish ?> 175 189 <div class="misc-pub-section curtime"> 176 190 <span id="timestamp"> 177 191 <?php printf($stamp, $date); ?></span> … … 202 216 <div id="publishing-action"> 203 217 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="ajax-loading" alt="" /> 204 218 <?php 205 if ( !in_array( $post->post_status, array('publish', 'future', 'private' ) ) || 0 == $post->ID ) {219 if ( !in_array( $post->post_status, array('publish', 'future', 'private','inherit') ) || 0 == $post->ID ) { 206 220 if ( $can_publish ) : 207 221 if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> 208 222 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e('Schedule') ?>" /> … … 982 996 <a href="#" class="remove"><?php _e( 'Remove Featured Image' ); ?></a> 983 997 </div> 984 998 <?php 985 } 986 No newline at end of file 999 } 1000 1001 /** 1002 * Display attachment/media-specific information 1003 * 1004 * @since 3.5.0 1005 * 1006 * @param object $post 1007 */ 1008 function attachment_data_meta_box( $post ) { 1009 $att_url = wp_get_attachment_url( $post->ID ); 1010 $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); 1011 ?> 1012 <label for="_wp_attachment_image_alt"><strong>Alternative text</strong></label><br /> 1013 <input type="text" class="widefat" name="_wp_attachment_image_alt" value="<?php echo esc_attr( $alt_text ); ?>" /> 1014 </p> 1015 1016 <p> 1017 <label for="excerpt"><strong>Excerpt</strong></label><br /> 1018 <textarea class="widefat" name="excerpt"><?php echo $post->post_excerpt; ?></textarea> 1019 </p> 1020 1021 <p> 1022 <label for="attachment_url"><strong>File URL</strong></label><br /> 1023 <input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" value="<?php echo esc_attr($att_url); ?>" /><br /> 1024 <em><?php _e( 'Location of the uploaded file.' ); ?></em> 1025 </p> 1026 <?php 1027 } -
wp-admin/css/wp-admin.css
3929 3929 margin: 8px 0; 3930 3930 } 3931 3931 3932 .describe .imgedit-wrap table td { 3932 .describe .imgedit-wrap table td, 3933 .wp_attachment_holder .imgedit-wrap table td { 3933 3934 vertical-align: top; 3934 3935 padding-top: 0; 3935 3936 } -
wp-admin/post.php
148 148 $parent_file = "edit.php"; 149 149 $submenu_file = "edit.php"; 150 150 $post_new_file = "post-new.php"; 151 } elseif ( 'attachment' === $post_type ) { 152 $parent_file = 'upload.php'; 153 $submenu_file = 'upload.php'; 154 $post_new_file = 'media-new.php'; 151 155 } else { 152 156 if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) 153 157 $parent_file = $post_type_object->show_in_menu; -
wp-admin/edit-form-advanced.php
24 24 add_action( 'admin_footer', 'wp_print_media_templates' ); 25 25 } 26 26 27 if ( post_type_supports( $post_type, 'image_editor' ) ) { 28 wp_enqueue_script( 'image-edit' ); 29 wp_enqueue_style( 'imgareaselect' ); 30 } 31 27 32 /** 28 33 * Post ID global 29 34 * @name $post_ID … … 77 82 78 83 $notice = false; 79 84 $form_extra = ''; 80 if ( 'auto-draft' == $post->post_status) {85 if ( 'auto-draft' == get_post_status( $post ) ) { 81 86 if ( 'edit' == $action ) 82 87 $post->post_title = ''; 83 88 $autosave = false; … … 125 130 add_meta_box($tax_name . 'div', $label, 'post_categories_meta_box', null, 'side', 'core', array( 'taxonomy' => $tax_name )); 126 131 } 127 132 133 if ( 'attachment' == $post_type ) 134 add_meta_box( 'attachmentdata', __('Attachment Data'), 'attachment_data_meta_box', null, 'normal', 'core' ); 135 128 136 if ( post_type_supports($post_type, 'page-attributes') ) 129 137 add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core'); 130 138 … … 144 152 if ( post_type_supports($post_type, 'comments') ) 145 153 add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core'); 146 154 147 if ( ( 'publish' == $post->post_status || 'private' == $post->post_status) && post_type_supports($post_type, 'comments') )155 if ( ( 'publish' == get_post_status( $post ) || 'private' == get_post_status( $post ) ) && post_type_supports($post_type, 'comments') ) 148 156 add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', null, 'normal', 'core'); 149 157 150 if ( ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) )158 if ( ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) 151 159 add_meta_box('slugdiv', __('Slug'), 'post_slug_meta_box', null, 'normal', 'core'); 152 160 153 161 if ( post_type_supports($post_type, 'author') ) { … … 158 166 if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) 159 167 add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core'); 160 168 169 if ( post_type_supports( $post_type, 'image_editor' ) ) 170 add_action( 'edit_form_advanced_before', 'edit_form_image_editor' ); 171 161 172 do_action('add_meta_boxes', $post_type, $post); 162 173 do_action('add_meta_boxes_' . $post_type, $post); 163 174 … … 269 280 <input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" /> 270 281 <?php 271 282 } 272 if ( 'draft' != $post->post_status)283 if ( 'draft' != get_post_status( $post ) ) 273 284 wp_original_referer_field(true, 'previous'); 274 285 275 286 echo $form_extra; … … 283 294 284 295 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 285 296 <div id="post-body-content"> 286 <?php if ( post_type_supports($post_type, 'title') ) { ?> 297 <?php 298 do_action( 'edit_form_advanced_before' ); 299 300 if ( post_type_supports($post_type, 'title') ) { 301 ?> 287 302 <div id="titlediv"> 288 303 <div id="titlewrap"> 289 304 <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label> 290 305 <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" /> 291 306 </div> 292 307 <div class="inside"> 293 <?php294 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';295 $shortlink = wp_get_shortlink($post->ID, 'post');296 if ( !empty($shortlink) )297 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-tiny" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';308 <?php 309 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : ''; 310 $shortlink = wp_get_shortlink($post->ID, 'post'); 311 if ( !empty($shortlink) ) 312 $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-tiny" onclick="prompt('URL:', jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>'; 298 313 299 if ( $post_type_object->public && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 300 <div id="edit-slug-box"> 314 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?> 315 <div id="edit-slug-box"> 316 <?php 317 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != get_post_status( $post ) ) 318 echo $sample_permalink_html; 319 ?> 320 </div> 301 321 <?php 302 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status ) 303 echo $sample_permalink_html; 304 ?> 305 </div> 306 <?php 307 } 322 } 308 323 ?> 309 324 </div> 310 325 <?php 311 326 wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); 312 327 ?> 313 </div> 314 <?php } ?> 328 </div><!-- /titlediv --> 329 <?php 330 } 315 331 316 <?php if ( post_type_supports($post_type, 'editor') ) { ?> 332 do_action( 'edit_form_after_title' ); 333 334 if ( post_type_supports($post_type, 'editor') ) { 335 ?> 317 336 <div id="postdivrich" class="postarea"> 318 337 319 338 <?php wp_editor($post->post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'sample-permalink,post-preview') ); ?> … … 323 342 <td class="autosave-info"> 324 343 <span class="autosave-message"> </span> 325 344 <?php 326 if ( 'auto-draft' != $post->post_status) {345 if ( 'auto-draft' != get_post_status( $post ) ) { 327 346 echo '<span id="last-edit">'; 328 347 if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) { 329 348 $last_user = get_userdata($last_id); … … 337 356 </tr></tbody></table> 338 357 339 358 </div> 340 <?php } ?> 359 <?php 360 } 361 362 do_action( 'edit_form_after_editor' ); 363 ?> 341 364 </div><!-- /post-body-content --> 342 365 343 366 <div id="postbox-container-1" class="postbox-container">