Ticket #12214: singular_label.diff
| File singular_label.diff, 3.0 KB (added by , 16 years ago) |
|---|
-
wp-includes/post.php
16 16 */ 17 17 function create_initial_post_types() { 18 18 register_post_type( 'post', array( 'label' => __('Posts'), 19 'singular_label' => __('Post'), 19 20 'public' => true, 20 21 'show_ui' => false, 21 22 '_builtin' => true, … … 28 29 ) ); 29 30 30 31 register_post_type( 'page', array( 'label' => __('Pages'), 32 'singular_label' => __('Page'), 31 33 'public' => true, 32 34 'show_ui' => false, 33 35 '_builtin' => true, … … 51 53 ) ); 52 54 53 55 register_post_type( 'revision', array( 'label' => __('Revisions'), 56 'singular_label' => __('Revision'), 54 57 'public' => false, 55 58 '_builtin' => true, 56 59 '_edit_link' => 'revision.php?revision=%d', … … 746 749 $wp_post_types = array(); 747 750 748 751 // Args prefixed with an underscore are reserved for internal use. 749 $defaults = array('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 );752 $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 ); 750 753 $args = wp_parse_args($args, $defaults); 751 754 $args = (object) $args; 752 755 … … 768 771 if ( false === $args->label ) 769 772 $args->label = $post_type; 770 773 774 if ( false === $args->singular_label ) 775 $args->singular_label = $args->label; 776 771 777 if ( empty($args->capability_type) ) 772 778 $args->capability_type = 'post'; 773 779 if ( empty($args->edit_cap) ) -
wp-admin/post-new.php
24 24 25 25 $post_type_object = get_post_type_object($post_type); 26 26 27 $title = sprintf(__('Add New %s'), $post_type_object-> label);27 $title = sprintf(__('Add New %s'), $post_type_object->singular_label); 28 28 29 29 $editing = true; 30 30 wp_enqueue_script('autosave'); -
wp-admin/post.php
195 195 wp_enqueue_script('autosave'); 196 196 } 197 197 198 $title = sprintf(__('Edit %s'), $post_type_object-> label);198 $title = sprintf(__('Edit %s'), $post_type_object->singular_label); 199 199 $post = get_post_to_edit($post_id); 200 200 201 201 include('edit-form-advanced.php');