Ticket #24018: 24018.patch
File 24018.patch, 13.6 KB (added by , 11 years ago) |
---|
-
wp-admin/post.php
181 181 182 182 add_action( 'admin_footer', '_admin_notice_post_locked' ); 183 183 184 $title = $post_type_object->labels->edit_item; 184 if($post_type_object->labels->edit_item == 'Edit Post') 185 $title = 'Edit '.ucfirst($post->post_format).' Post'; 186 else 187 $title = $post_type_object->labels->edit_item; 188 185 189 $post = get_post($post_id, OBJECT, 'edit'); 186 190 187 191 if ( post_type_supports($post_type, 'comments') ) { -
wp-admin/edit-form-advanced.php
157 157 158 158 $all_post_formats = array( 159 159 'standard' => array ( 160 'description' => __( 'Use the editor below to compose your post.' ) 161 ), 162 'image' => array ( 163 'description' => __( 'Select or upload an image for your post.' ) 164 ), 165 'gallery' => array ( 166 'description' => __( 'Use the Add Media button to select or upload images for your gallery.' ) 167 ), 168 'link' => array ( 169 'description' => __( 'Add a link URL below.' ) 170 ), 171 'video' => array ( 172 'description' => __( 'Select or upload a video, or paste a video embed code into the box.' ) 173 ), 174 'audio' => array ( 175 'description' => __( 'Select or upload an audio file, or paste an audio embed code into the box.' ) 176 ), 177 'chat' => array ( 178 'description' => __( 'Copy a chat or Q&A transcript into the editor.' ) 179 ), 180 'status' => array ( 181 'description' => __( 'Use the editor to compose a status update. What’s new?' ) 182 ), 183 'quote' => array ( 184 'description' => __( 'Add a source and URL if you have them. Use the editor to compose the quote.' ) 185 ), 186 'aside' => array ( 187 'description' => __( 'Use the editor to share a quick thought or side topic.' ) 188 ) 160 'title' => $post_type_object->labels->formats->standard_item, 161 'description' => __( 'Add a title and use the editor to compose your post.' ) 162 ), 163 'image' => array ( 164 'title' => $post_type_object->labels->formats->image_item, 165 'description' => __( 'Select or upload an image to use for your post.' ) 166 ), 167 'gallery' => array ( 168 'title' => $post_type_object->labels->formats->gallery_item, 169 'description' => __( 'Use the Add Media button to select or upload images for your gallery.' ) 170 ), 171 'link' => array ( 172 'title' => $post_type_object->labels->formats->link_item, 173 'description' => __( 'Add a link URL below.' ) 174 ), 175 'video' => array ( 176 'title' => $post_type_object->labels->formats->video_item, 177 'description' => __( 'Select or upload a video, or paste a video embed code into the box.' ) 178 ), 179 'audio' => array ( 180 'title' => $post_type_object->labels->formats->audio_item, 181 'description' => __( 'Select or upload an audio file, or paste an audio embed code into the box.' ) 182 ), 183 'chat' => array ( 184 'title' => $post_type_object->labels->formats->chat_item, 185 'description' => __( 'Copy a chat or Q&A transcript into the editor.' ) 186 ), 187 'status' => array ( 188 'title' => $post_type_object->labels->formats->status_item, 189 'description' => __( 'Use the editor to compose a status update. What’s new?' ) 190 ), 191 'quote' => array ( 192 'title' => $post_type_object->labels->formats->quote_item, 193 'description' => __( 'Copy a quotation into the box. Also add the source and URL if you have them.' ) 194 ), 195 'aside' => array ( 196 'title' => $post_type_object->labels->formats->aside_item, 197 'description' => __( 'An aside is a quick thought or side topic. Use the editor to compose one.' ) 198 ) 189 199 ); 190 200 191 201 foreach ( $all_post_formats as $slug => $attr ) { … … 195 205 $active_post_type_slug = $slug; 196 206 } 197 207 198 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . $attr['description'] . '" data-wp-format="' . $slug . '" title="' . ucfirst( $slug ) . '"><div class="' . $slug . '"></div><span class="post-format-title">' . ucfirst( $slug ) . '</span></a>';208 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . esc_attr( $attr['description'] ) . '" data-wp-format="' . $slug . '" title="' . esc_attr( $attr['title'] ) . '"><div class="' . $slug . '"></div></a>'; 199 209 } 200 210 201 211 $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) ); … … 391 401 <?php if ( ! empty( $post_format_options ) ) : ?> 392 402 <div class="wp-post-format-ui<?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>"> 393 403 <div class="post-format-options"> 394 <?php echo $post_format_options; ?> 404 <span class="post-format-tip"><?php echo $all_post_formats[ $post_format ]['title']; ?></span> 405 <?php echo $post_format_options; ?> 395 406 </div> 396 407 </div> 397 408 <?php endif; ?> -
wp-admin/includes/upgrade.php
147 147 'post_content' => $first_post, 148 148 'post_excerpt' => '', 149 149 'post_title' => __('Hello world!'), 150 'post_format' => __('standard'), 150 151 /* translators: Default post slug */ 151 152 'post_name' => sanitize_title( _x('hello-world', 'Default post slug') ), 152 153 'post_modified' => $now, -
wp-admin/includes/schema.php
144 144 post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', 145 145 post_content longtext NOT NULL, 146 146 post_title text NOT NULL, 147 post_format text NOT NULL, 147 148 post_excerpt text NOT NULL, 148 149 post_status varchar(20) NOT NULL default 'publish', 149 150 comment_status varchar(20) NOT NULL default 'open', -
wp-admin/includes/meta-boxes.php
315 315 $post_formats[0][] = $post_format; 316 316 ?> 317 317 <div id="post-formats-select"> 318 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>319 318 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php echo get_post_format_string( 'standard' ); ?></label> 319 <?php foreach ( $post_formats[0] as $format ) : ?> 320 320 <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> 321 321 <?php endforeach; ?><br /> 322 322 </div> -
wp-includes/post.php
566 566 * @var string 567 567 */ 568 568 public $filter; 569 570 /** 571 * 572 * @var string 573 */ 574 public $post_format = ''; 569 575 570 576 public static function get_instance( $post_id ) { 571 577 global $wpdb; … … 1425 1431 */ 1426 1432 function get_post_type_labels( $post_type_object ) { 1427 1433 $nohier_vs_hier_defaults = array( 1428 'name' => array( _x('Posts', 'post type general name'), _x('Pages', 'post type general name') ), 1429 'singular_name' => array( _x('Post', 'post type singular name'), _x('Page', 'post type singular name') ), 1430 'add_new' => array( _x('Add New', 'post'), _x('Add New', 'page') ), 1431 'add_new_item' => array( __('Add New Post'), __('Add New Page') ), 1432 'edit_item' => array( __('Edit Post'), __('Edit Page') ), 1433 'new_item' => array( __('New Post'), __('New Page') ), 1434 'view_item' => array( __('View Post'), __('View Page') ), 1435 'search_items' => array( __('Search Posts'), __('Search Pages') ), 1436 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1437 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1438 'parent_item_colon' => array( null, __('Parent Page:') ), 1439 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1434 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), 1435 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), 1436 'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ), 1437 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), 1438 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), 1439 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), 1440 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), 1441 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), 1442 'not_found' => array( __( 'No posts found.' ), __( 'No pages found.' ) ), 1443 'not_found_in_trash' => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ), 1444 'parent_item_colon' => array( null, __( 'Parent Page:' ) ), 1445 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 1446 'formats' => array( 1447 'standard_item' => array( __( 'Standard Post' ), __( 'Standard Page' ) ), 1448 'edit_standard_item' => array( __( 'Edit Standard Post' ), __( 'Edit Standard Page' ) ), 1449 'aside_item' => array( __( 'Aside Post' ), __( 'Aside Page' ) ), 1450 'edit_aside_item' => array( __( 'Edit Aside Post' ), __( 'Edit Aside Page' ) ), 1451 'chat_item' => array( __( 'Chat Post' ), __( 'Chat Page' ) ), 1452 'edit_chat_item' => array( __( 'Edit Chat Post' ), __( 'Edit Chat Page' ) ), 1453 'gallery_item' => array( __( 'Gallery Post' ), __( 'Gallery Page' ) ), 1454 'edit_gallery_item' => array( __( 'Edit Gallery Post' ), __( 'Edit Gallery Page' ) ), 1455 'link_item' => array( __( 'Link Post' ), __( 'Link Page' ) ), 1456 'edit_link_item' => array( __( 'Edit Link Post' ), __( 'Edit Link Page' ) ), 1457 'image_item' => array( __( 'Image Post' ), __( 'Image Page' ) ), 1458 'edit_image_item' => array( __( 'Edit Image Post' ), __( 'Edit Image Page' ) ), 1459 'quote_item' => array( __( 'Quote Post' ), __( 'Quote Page' ) ), 1460 'edit_quote_item' => array( __( 'Edit Quote Post' ), __( 'Edit Quote Page' ) ), 1461 'status_item' => array( __( 'Status Post' ), __( 'Status Page' ) ), 1462 'edit_status_item' => array( __( 'Edit Status Post' ), __( 'Edit Status Page' ) ), 1463 'video_item' => array( __( 'Video Post' ), __( 'Video Page' ) ), 1464 'edit_video_item' => array( __( 'Edit Video Post' ), __( 'Edit Video Page' ) ), 1465 'audio_item' => array( __( 'Audio Post' ), __( 'Audio Page' ) ), 1466 'edit_audio_item' => array( __( 'Edit Audio Post' ), __( 'Edit Audio Page' ) ), 1467 ) 1440 1468 ); 1441 1469 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1442 1470 … … 2623 2651 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 2624 2652 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 2625 2653 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 2626 'post_content' => '', 'post_title' => '' );2654 'post_content' => '', 'post_title' => '', 'post_format' => ''); 2627 2655 2628 2656 $postarr = wp_parse_args($postarr, $defaults); 2629 2657 … … 2784 2812 $post_name = wp_unique_post_slug($post_name, $post_ID, $post_status, $post_type, $post_parent); 2785 2813 2786 2814 // expected_slashed (everything!) 2787 $data = compact( array( 'post_ author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) );2815 $data = compact( array( 'post_format', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) ); 2788 2816 $data = apply_filters('wp_insert_post_data', $data, $postarr); 2789 2817 $data = wp_unslash( $data ); 2790 2818 $where = array( 'ID' => $post_ID );