Ticket #23503: 23503.5.patch
| File 23503.5.patch, 10.9 KB (added by , 13 years ago) |
|---|
-
wp-admin/edit-form-advanced.php
142 142 143 143 $all_post_formats = array( 144 144 'standard' => array ( 145 'title' => $post_type_object->labels->formats->standard_item, 145 146 'description' => __( 'Add a title and use the editor to compose your post.' ) 146 147 ), 147 148 'image' => array ( 149 'title' => $post_type_object->labels->formats->image_item, 148 150 'description' => __( 'Select or upload an image to use for your post.' ) 149 151 ), 150 152 'gallery' => array ( 153 'title' => $post_type_object->labels->formats->gallery_item, 151 154 'description' => __( 'Use the Add Media button to select or upload images for your gallery.' ) 152 155 ), 153 156 'link' => array ( 157 'title' => $post_type_object->labels->formats->link_item, 154 158 'description' => __( 'Add a link URL below.' ) 155 159 ), 156 160 'video' => array ( 161 'title' => $post_type_object->labels->formats->video_item, 157 162 'description' => __( 'Select or upload a video, or paste a video embed code into the box.' ) 158 163 ), 159 164 'audio' => array ( 165 'title' => $post_type_object->labels->formats->audio_item, 160 166 'description' => __( 'Select or upload an audio file, or paste an audio embed code into the box.' ) 161 167 ), 162 168 'chat' => array ( 169 'title' => $post_type_object->labels->formats->chat_item, 163 170 'description' => __( 'Copy a chat or Q&A transcript into the editor.' ) 164 171 ), 165 172 'status' => array ( 173 'title' => $post_type_object->labels->formats->status_item, 166 174 'description' => __( 'Use the editor to compose a status update. What’s new?' ) 167 175 ), 168 176 'quote' => array ( 177 'title' => $post_type_object->labels->formats->quote_item, 169 178 'description' => __( 'Copy a quotation into the box. Also add the source and URL if you have them.' ) 170 179 ), 171 180 'aside' => array ( 181 'title' => $post_type_object->labels->formats->aside_item, 172 182 'description' => __( 'An aside is a quick thought or side topic. Use the editor to compose one.' ) 173 183 ) 174 184 ); … … 183 193 $active_post_format_description = $attr['description']; 184 194 } 185 195 186 $post_format_options .= '<a ' . $class . ' href="?format=' . $slug . '" data-description="' . $attr['description'] . '" data-wp-format="' . $slug . '" title="' . ucfirst( sprintf( __( '%s Post' ), $slug )) . '"><div class="' . $slug . '"></div></a>';196 $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>'; 187 197 } 188 198 189 199 $current_post_format = array( 'currentPostFormat' => esc_html( $active_post_type_slug ) ); … … 405 415 406 416 <?php if ( ! empty( $post_format_options ) ) : ?> 407 417 <div class="post-format-options"> 408 <span class="post-format-tip"> Standard Post</span>418 <span class="post-format-tip"><?php echo $all_post_formats[ $post_format ]['title']; ?></span> 409 419 <?php echo $post_format_options; ?> 410 420 </div> 411 421 <?php endif; ?> -
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>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 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 /> -
wp-admin/options-writing.php
87 87 <th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th> 88 88 <td> 89 89 <select name="default_post_format" id="default_post_format"> 90 <option value="0"><?php _e('Standard'); ?></option>90 <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> 91 91 <?php foreach ( $post_formats[0] as $format ): ?> 92 92 <option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option> 93 93 <?php endforeach; ?> -
wp-includes/post.php
1425 1425 */ 1426 1426 function get_post_type_labels( $post_type_object ) { 1427 1427 $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' ) ) 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' ) ), 1440 'formats' => array( 1441 'standard_item' => array( __( 'Standard Post' ), __( 'Standard Page' ) ), 1442 'edit_standard_item' => array( __( 'Edit Standard Post' ), __( 'Edit Standard Page' ) ), 1443 'aside_item' => array( __( 'Aside Post' ), __( 'Aside Page' ) ), 1444 'edit_aside_item' => array( __( 'Edit Aside Post' ), __( 'Edit Aside Page' ) ), 1445 'chat_item' => array( __( 'Chat Post' ), __( 'Chat Page' ) ), 1446 'edit_chat_item' => array( __( 'Edit Chat Post' ), __( 'Edit Chat Page' ) ), 1447 'gallery_item' => array( __( 'Gallery Post' ), __( 'Gallery Page' ) ), 1448 'edit_gallery_item' => array( __( 'Edit Gallery Post' ), __( 'Edit Gallery Page' ) ), 1449 'link_item' => array( __( 'Link Post' ), __( 'Link Page' ) ), 1450 'edit_link_item' => array( __( 'Edit Link Post' ), __( 'Edit Link Page' ) ), 1451 'image_item' => array( __( 'Image Post' ), __( 'Image Page' ) ), 1452 'edit_image_item' => array( __( 'Edit Image Post' ), __( 'Edit Image Page' ) ), 1453 'quote_item' => array( __( 'Quote Post' ), __( 'Quote Page' ) ), 1454 'edit_quote_item' => array( __( 'Edit Quote Post' ), __( 'Edit Quote Page' ) ), 1455 'status_item' => array( __( 'Status Post' ), __( 'Status Page' ) ), 1456 'edit_status_item' => array( __( 'Edit Status Post' ), __( 'Edit Status Page' ) ), 1457 'video_item' => array( __( 'Video Post' ), __( 'Video Page' ) ), 1458 'edit_video_item' => array( __( 'Edit Video Post' ), __( 'Edit Video Page' ) ), 1459 'audio_item' => array( __( 'Audio Post' ), __( 'Audio Page' ) ), 1460 'edit_audio_item' => array( __( 'Edit Audio Post' ), __( 'Edit Audio Page' ) ), 1461 ) 1440 1462 ); 1441 1463 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1442 1464 … … 1463 1485 if ( ! isset( $object->labels['name_admin_bar'] ) ) 1464 1486 $object->labels['name_admin_bar'] = isset( $object->labels['singular_name'] ) ? $object->labels['singular_name'] : $object->name; 1465 1487 1466 if ( ! isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) )1488 if ( ! isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) ) 1467 1489 $object->labels['menu_name'] = $object->labels['name']; 1468 1490 1469 if ( ! isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) )1491 if ( ! isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) ) 1470 1492 $object->labels['all_items'] = $object->labels['menu_name']; 1471 1493 1472 foreach ( $nohier_vs_hier_defaults as $key => $value)1473 $defaults[$key] = $object->hierarchical ? $value[1] : $value[0];1494 if ( ! isset( $object->labels['formats'] ) ) 1495 $object->labels['formats'] = array(); 1474 1496 1497 $defaults = array(); 1498 foreach ( $nohier_vs_hier_defaults as $key => $value ) { 1499 if ( 'formats' == $key ) { 1500 $defaults['formats'] = array(); 1501 foreach ( $value as $format => $_value ) 1502 $defaults['formats'][ $format ] = $object->hierarchical ? $_value[1] : $_value[0]; 1503 $object->labels['formats'] = (object) array_merge( $defaults['formats'], $object->labels['formats'] ); 1504 } else { 1505 $defaults[ $key ] = $object->hierarchical ? $value[1] : $value[0]; 1506 } 1507 } 1508 1475 1509 $labels = array_merge( $defaults, $object->labels ); 1476 return (object)$labels; 1510 1511 return (object) $labels; 1477 1512 } 1478 1513 1479 1514 /**