Ticket #12968: post-types-i18n.diff
File post-types-i18n.diff, 26.0 KB (added by , 14 years ago) |
---|
-
wp-includes/nav-menu-template.php
155 155 $output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="'. esc_attr( $item->object ) .'" />'; 156 156 $output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="'. esc_attr( $item->menu_item_parent ) .'" />'; 157 157 $output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="'. esc_attr( $item->type ) .'" />'; 158 $output .= '<input type="hidden" class="menu-item-append" name="menu-item[' . $possible_object_id . '][menu-item-append]" value="'. esc_attr( $item->append ) .'" />';159 158 $output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="'. esc_attr( $item->title ) .'" />'; 160 159 $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="'. esc_attr( $item->url ) .'" />'; 161 $output .= '<input type="hidden" class="menu-item-append" name="menu-item[' . $possible_object_id . '][menu-item-append]" value="'. esc_attr( $item->append ) .'" />';162 160 $output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="'. esc_attr( $item->target ) .'" />'; 163 161 $output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="'. esc_attr( $item->attr_title ) .'" />'; 164 162 $output .= '<input type="hidden" class="menu-item-description" name="menu-item[' . $possible_object_id . '][menu-item-description]" value="'. esc_attr( $item->description ) .'" />'; -
wp-includes/post.php
16 16 */ 17 17 function create_initial_post_types() { 18 18 register_post_type( 'post', array( 19 'label' => __( 'Posts' ),20 'singular_label' => __( 'Post' ),21 19 'public' => true, 22 20 'show_ui' => false, 23 21 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ … … 30 28 ) ); 31 29 32 30 register_post_type( 'page', array( 33 'label' => __( 'Pages' ),34 'singular_label' => __( 'Page' ),35 31 'public' => true, 36 32 'show_ui' => false, 37 33 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ … … 769 765 * 770 766 * Optional $args contents: 771 767 * 772 * label - A (plural) descriptive name for the post type marked for translation. Defaults to $post_type.773 * singular_label - A (singular) descriptive name for the post type marked for translation. Defaults to $label.774 768 * description - A short descriptive summary of what the post type is. Defaults to blank. 775 769 * public - Whether posts of this type should be shown in the admin UI. Defaults to false. 776 770 * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true if the type is not public, false if the type is public. … … 790 784 * supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none. 791 785 * register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback. 792 786 * taxonomies - An array of taxonomy identifiers that will be registered for the post type. Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type(). 793 * 787 * labels - An array of labels specific to that post type. Accepts the following keys: 788 * 794 789 * @package WordPress 795 790 * @subpackage Post 796 791 * @since 2.9.0 … … 806 801 $wp_post_types = array(); 807 802 808 803 // Args prefixed with an underscore are reserved for internal use. 809 $defaults = array('label ' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true );804 $defaults = array('labels' => array(), 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true ); 810 805 $args = wp_parse_args($args, $defaults); 811 806 $args = (object) $args; 812 807 … … 825 820 if ( null === $args->exclude_from_search ) 826 821 $args->exclude_from_search = !$args->public; 827 822 828 if ( false === $args->label )829 $args->label = $post_type;830 831 if ( false === $args->singular_label )832 $args->singular_label = $args->label;833 834 823 if ( empty($args->capability_type) ) 835 824 $args->capability_type = 'post'; 836 825 if ( empty($args->edit_cap) ) … … 880 869 if ( $args->register_meta_box_cb ) 881 870 add_action('add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1); 882 871 872 $args->labels = _post_type_labels_from_args( $args ); 873 874 // we keep these two only for backwards compatibility 875 // TODO: remove in 3.1 876 $args->label = $args->labels->name; 877 $args->singular_label = $args->labels->singular_name; 878 883 879 $wp_post_types[$post_type] = $args; 884 880 885 881 add_action( 'future_' . $post_type, '_future_post_hook', 5, 2 ); … … 891 887 return $args; 892 888 } 893 889 890 function _post_type_labels_from_args( $args ) { 891 $nohier_vs_hier_defaults = array( 892 'name' => array( _x('Posts', 'post type general name'), _x('Pages', 'post type general name') ), 893 'singular_name' => array( _x('Post', 'post type singular name'), _x('Page', 'post type singular name') ), 894 'add_new' => array( _x('Add New', 'post'), _x('Add New', 'page') ), 895 'add_new_item' => array( __('Add New Post'), __('Add New Page') ), 896 'edit_item' => array( __('Edit Post'), __('Edit Page') ), 897 'edit' => array( _x('Edit', 'post'), _x('Edit', 'page') ), 898 'new_item' => array( __('New Post'), __('New Page') ), 899 'search_items' => array( __('Search Posts'), __('Search Pages') ), 900 'not_found' => array( __('No posts found'), __('No pages found') ), 901 'not_found_in_trash' => array( __('No posts found in Trash'), __('No pages found in Trash') ), 902 'view' => array( __('View Post'), __('View Page') ), 903 'parent' => array( null, __('Parent Page:') ) 904 ); 905 906 // try to get missing (singular_)?name from older style (singular_)?label member variables 907 // we keep that for backwards compatibility 908 // TODO: remove in 3.1 909 if ( !isset( $args->labels['name'] ) && isset( $args->label ) ) $args->labels['name'] = $args->label; 910 if ( !isset( $args->labels['singular_name'] ) && isset( $args->singular_label ) ) $args->labels['singular_name'] = $args->singular_label; 911 912 $defaults = array_map( create_function( '$x', $args->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults ); 913 $labels = array_merge( $defaults, $args->labels ); 914 return (object)$labels; 915 } 916 894 917 /** 895 918 * Register support of certain features for a post type. 896 919 * -
wp-includes/nav-menu.php
231 231 'menu-item-parent-id' => 0, 232 232 'menu-item-position' => 0, 233 233 'menu-item-type' => 'custom', 234 'menu-item-append' => 'custom',235 234 'menu-item-title' => '', 236 235 'menu-item-url' => '', 237 236 'menu-item-description' => '', … … 277 276 $original_title = $original_object->post_title; 278 277 279 278 if ( 'trash' == get_post_status( $args['menu-item-object-id'] ) ) { 280 $post_type_object = get_post_type_object( $args['menu-item-object'] ); 281 if ( isset( $post_type_object->singular_label ) ) 282 return new WP_Error('update_nav_menu_item_failed', sprintf(__('The menu item "%1$s" belongs to a %2$s that is in the trash, so it cannot be updated.'), $args['menu-item-title'], $post_type_object->singular_label ) ); 283 else 284 return new WP_Error('update_nav_menu_item_failed', sprintf(__('The menu item "%1$s" belongs to something that is in the trash, so it cannot be updated.'), $args['menu-item-title'] ) ); 279 return new WP_Error('update_nav_menu_item_failed', sprintf(__('The menu item "%1$s" belongs to something that is in the trash, so it cannot be updated.'), $args['menu-item-title'] ) ); 285 280 } 286 281 } 287 282 … … 449 444 * - object_id: The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories. 450 445 * - type: The family of objects originally represented, such as "post_type" or "taxonomy." 451 446 * - object: The type of object originally represented, such as "category," "post", or "attachment." 452 * - append:The singular label used to describe this type of menu item.447 * - type_label: The singular label used to describe this type of menu item. 453 448 * - post_parent: The DB ID of the original object's parent object, if any (0 otherwise). 454 449 * - menu_item_parent: The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise. 455 450 * - url: The URL to which this menu item points. … … 476 471 477 472 if ( 'post_type' == $menu_item->type ) { 478 473 $object = get_post_type_object( $menu_item->object ); 479 $menu_item-> append = $object->singular_label;474 $menu_item->type_label = $object->labels->name_singular; 480 475 $menu_item->url = get_permalink( $menu_item->object_id ); 481 476 482 477 $original_object = get_post( $menu_item->object_id ); … … 485 480 486 481 } elseif ( 'taxonomy' == $menu_item->type ) { 487 482 $object = get_taxonomy( $menu_item->object ); 488 $menu_item-> append= $object->singular_label;483 $menu_item->type_label = $object->singular_label; 489 484 $menu_item->url = get_term_link( (int) $menu_item->object_id, $menu_item->object ); 490 485 491 486 $original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' ); 492 487 $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title; 493 488 494 489 } else { 495 $menu_item-> append= __('Custom');490 $menu_item->type_label = __('Custom'); 496 491 $menu_item->title = $menu_item->post_title; 497 492 $menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true ); 498 493 } … … 512 507 513 508 $object = get_post_type_object( $menu_item->post_type ); 514 509 $menu_item->object = $object->name; 515 $menu_item-> append = strtolower( $object->singular_label );510 $menu_item->type_label = $object->labels->name_singular; 516 511 517 512 $menu_item->title = $menu_item->post_title; 518 513 $menu_item->url = get_permalink( $menu_item->ID ); … … 533 528 534 529 $object = get_taxonomy( $menu_item->taxonomy ); 535 530 $menu_item->object = $object->name; 536 $menu_item-> append = strtolower( $object->singular_label );531 $menu_item->type_label = $object->singular_label; 537 532 538 533 $menu_item->title = $menu_item->name; 539 534 $menu_item->url = get_term_link( $menu_item, $menu_item->taxonomy ); -
wp-admin/post-new.php
26 26 27 27 $post_type_object = get_post_type_object($post_type); 28 28 29 $title = sprintf(__('Add New %s'), $post_type_object->singular_label);29 $title = $post_type_object->labels->add_new_item; 30 30 31 31 $editing = true; 32 32 -
wp-admin/includes/post.php
1079 1079 list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); 1080 1080 1081 1081 if ( 'publish' == $post->post_status ) { 1082 if ( 'post' == $post->post_type ) { 1083 $view_post = __('View Post'); 1084 } elseif ( 'page' == $post->post_type ) { 1085 $view_post = __('View Page'); 1086 } else { 1087 $ptype = get_post_type_object($post->post_type); 1088 $view_post = sprintf(__('View %s'), $ptype->singular_label); 1089 } 1082 $ptype = get_post_type_object($post->post_type); 1083 $view_post = $ptype->labels->view; 1090 1084 $title = __('Click to edit this part of the permalink'); 1091 1085 } else { 1092 1086 $title = __('Temporary permalink. Click to edit this part.'); -
wp-admin/includes/template.php
13 13 * 14 14 * @since 2.7 15 15 * 16 * Outputs the HTML for the hidden table rows used in Categories, Link Ca tegories and Tags quick edit.16 * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit. 17 17 * 18 * @param string $type "edit-tags", "categorie s" or "edit-link-categories"18 * @param string $type "edit-tags", "categoried" or "edit-link-categories" 19 19 * @param string $taxonomy The taxonomy of the row. 20 20 * @return 21 21 */ … … 1566 1566 $attributes = 'class="post-title page-title column-title"' . $style; 1567 1567 $edit_link = get_edit_post_link( $page->ID ); 1568 1568 ?> 1569 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: '). esc_html($parent_name) : ''; ?></strong>1569 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent . ' ' . esc_html($parent_name) : ''; ?></strong> 1570 1570 <?php 1571 1571 $actions = array(); 1572 1572 if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { … … 3328 3328 if ( isset($post_type_object) ) { 3329 3329 switch ( $screen->id ) { 3330 3330 case $post_type_object->name: 3331 $default_action = array('edit.php?post_type=' . $post_type_object->name => array( sprintf(__('Edit %s'), $post_type_object->label), $post_type_object->edit_type_cap));3331 $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object->edit_type_cap)); 3332 3332 break; 3333 3333 case "edit-{$post_type_object->name}": 3334 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array( sprintf(__('New %s'), $post_type_object->singular_label), $post_type_object->edit_type_cap));3334 $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->edit_type_cap)); 3335 3335 break; 3336 3336 } 3337 3337 } … … 3746 3746 if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) ) 3747 3747 $post_type = $_GET['post_type']; 3748 3748 $post_type_object = get_post_type_object($post_type); 3749 $per_page_label = $post_type_object->label ;3749 $per_page_label = $post_type_object->labels->name; 3750 3750 break; 3751 3751 case 'ms-sites': 3752 3752 $per_page_label = __('Sites'); -
wp-admin/includes/nav-menu.php
59 59 $original_title = $original_object->post_title; 60 60 } 61 61 ?> 62 <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">62 <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo esc_attr( $item->object ); ?>"> 63 63 <dl class="menu-item-bar <?php 64 64 if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ) 65 65 echo 'menu-item-edit-active'; … … 69 69 <dt class="menu-item-handle"> 70 70 <span class="item-title"><?php echo esc_html( $item->title ); ?></span> 71 71 <span class="item-controls"> 72 <span class="item-type"><?php echo esc_html( $item-> append); ?></span>72 <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span> 73 73 <span class="item-order"> 74 74 <a href="<?php 75 75 echo wp_nonce_url( … … 161 161 162 162 <div class="menu-item-actions description-wide submitbox"> 163 163 <?php if( 'custom' != $item->type ) : ?> 164 <p class="link-to-original"><?php 165 _e('Original '); 166 echo esc_html( $item->append ); 167 echo ":"; ?> 164 <p class="link-to-original"> 165 <?php _e('Original:'); ?> 168 166 <a href="<?php echo esc_attr( $item->url ); ?>"> 169 167 <?php echo esc_html($original_title); ?> 170 168 </a> … … 184 182 <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" /> 185 183 </div> 186 184 187 <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />188 185 <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" /> 189 186 <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" /> 190 187 <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" /> … … 374 371 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); 375 372 if ( $post_type ) { 376 373 $id = $post_type->name; 377 add_meta_box( "add-{$id}", $post_type->label , 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );374 add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type ); 378 375 } 379 376 } 380 377 } … … 543 540 )); 544 541 545 542 if ( !$posts ) 546 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ).'</li>';543 $error = '<li id="error">'. $post_type['args']->labels->not_found .'</li>'; 547 544 548 545 $current_tab = 'all'; 549 546 if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) { … … 865 862 'menu-item-parent-id' => ( isset( $_item_object_data['menu-item-parent-id'] ) ? $_item_object_data['menu-item-parent-id'] : '' ), 866 863 'menu-item-position' => ( isset( $_item_object_data['menu-item-position'] ) ? $_item_object_data['menu-item-position'] : '' ), 867 864 'menu-item-type' => ( isset( $_item_object_data['menu-item-type'] ) ? $_item_object_data['menu-item-type'] : '' ), 868 'menu-item-append' => ( isset( $_item_object_data['menu-item-append'] ) ? $_item_object_data['menu-item-append'] : '' ),869 865 'menu-item-title' => ( isset( $_item_object_data['menu-item-title'] ) ? $_item_object_data['menu-item-title'] : '' ), 870 866 'menu-item-url' => ( isset( $_item_object_data['menu-item-url'] ) ? $_item_object_data['menu-item-url'] : '' ), 871 867 'menu-item-description' => ( isset( $_item_object_data['menu-item-description'] ) ? $_item_object_data['menu-item-description'] : '' ), -
wp-admin/post.php
177 177 wp_enqueue_script('autosave'); 178 178 } 179 179 180 $title = sprintf(__('Edit %s'), $post_type_object->singular_label);180 $title = $post_type_object->labels->edit_item; 181 181 $post = get_post_to_edit($post_id); 182 182 183 183 if ( post_type_supports($post_type, 'comments') ) { -
wp-admin/js/nav-menu.dev.js
809 809 'menu-item-parent-id', 810 810 'menu-item-position', 811 811 'menu-item-type', 812 'menu-item-append',813 812 'menu-item-title', 814 813 'menu-item-url', 815 814 'menu-item-description', -
wp-admin/menu.php
129 129 while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) ) 130 130 $ptype_menu_position++; 131 131 132 $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->label ), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-' . $ptype_class, $menu_icon ); 133 $submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype"); 134 /* translators: add new custom post type */ 135 $submenu["edit.php?post_type=$ptype"][10] = array( _x('Add New', 'post'), $ptype_obj->edit_type_cap, "post-new.php?post_type=$ptype" ); 132 $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->name ), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-' . $ptype_class, $menu_icon ); 133 $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->edit, $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype"); 134 $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->edit_type_cap, "post-new.php?post_type=$ptype" ); 136 135 137 136 $i = 15; 138 137 foreach ( $wp_taxonomies as $tax ) { -
wp-admin/nav-menus.php
299 299 300 300 if ( ! is_wp_error( $_menu_object ) ) { 301 301 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); 302 $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item- append', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' );302 $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' ); 303 303 // Loop through all the menu items' POST variables 304 304 if ( ! empty( $_POST['menu-item-db-id'] ) ) { 305 305 foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) { -
wp-admin/edit.php
137 137 exit; 138 138 } 139 139 140 $title = sprintf(__('Edit %s'), $post_type_object->label);141 142 140 wp_enqueue_script('inline-edit-post'); 143 141 144 142 $user_posts = false; … … 165 163 166 164 <div class="wrap"> 167 165 <?php screen_icon(); ?> 168 <h2><?php echo esc_html( $ title ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'post'); ?></a> <?php166 <h2><?php echo esc_html( $post_type_object->labels->edit_item ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php 169 167 if ( isset($_GET['s']) && $_GET['s'] ) 170 168 printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', get_search_query() ); ?> 171 169 </h2> … … 262 260 </ul> 263 261 264 262 <p class="search-box"> 265 <label class="screen-reader-text" for="post-search-input"><?php printf( _x('Search %s', '%s: post type name'), $post_type_object->label ); ?>:</label>263 <label class="screen-reader-text" for="post-search-input"><?php echo $post_type_object->labels->search_items; ?>:</label> 266 264 <input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" /> 267 <input type="submit" value="<?php echo esc_attr( sprintf( _x('Search %s', '%s: post type name'), $post_type_object->label )); ?>" class="button" />265 <input type="submit" value="<?php echo esc_attr( $post_type_object->labels->search_items ); ?>" class="button" /> 268 266 </p> 269 267 270 268 <input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" /> … … 410 408 <div class="clear"></div> 411 409 <p><?php 412 410 if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] ) 413 printf( __( 'No %s found in the Trash.' ), $post_type_object->label );411 echo $post_type_object->labels->not_found_in_trash; 414 412 else 415 printf( __( 'No %s found.' ), $post_type_object->label );413 echo $post_type_object->labels->not_found; 416 414 ?></p> 417 415 <?php } ?> 418 416 -
wp-admin/export.php
112 112 <select name="post_type" id="post_type"> 113 113 <option value="all" selected="selected"><?php _e('All Content'); ?></option> 114 114 <?php foreach ( get_post_types( array( 'public' => true, 'can_export' => true ), 'objects' ) as $post_type_obj ) { ?> 115 <option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->label ; ?></option>115 <option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->labels->name; ?></option> 116 116 <?php } ?> 117 117 </select> 118 118 </td>