WordPress.org

Make WordPress Core

Changeset 13101


Ignore:
Timestamp:
02/13/10 08:56:38 (4 years ago)
Author:
dd32
Message:

Introduce 'singular_label' for Post Types. Props scribu. See #12214

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post-new.php

    r12993 r13101  
    2525$post_type_object = get_post_type_object($post_type); 
    2626 
    27 $title = sprintf(__('Add New %s'), $post_type_object->label); 
     27$title = sprintf(__('Add New %s'), $post_type_object->singular_label); 
    2828 
    2929$editing = true; 
  • trunk/wp-admin/post.php

    r12927 r13101  
    196196    } 
    197197 
    198     $title = sprintf(__('Edit %s'), $post_type_object->label); 
     198    $title = sprintf(__('Edit %s'), $post_type_object->singular_label); 
    199199    $post = get_post_to_edit($post_id); 
    200200 
  • trunk/wp-includes/post.php

    r13075 r13101  
    1717function create_initial_post_types() { 
    1818    register_post_type( 'post', array(  'label' => __('Posts'), 
     19                                        'singular_label' => __('Post'), 
    1920                                        'public' => true, 
    2021                                        'show_ui' => false, 
     
    2930 
    3031    register_post_type( 'page', array(  'label' => __('Pages'), 
     32                                        'singular_label' => __('Page'), 
    3133                                        'public' => true, 
    3234                                        'show_ui' => false, 
     
    5254 
    5355    register_post_type( 'revision', array(  'label' => __('Revisions'), 
     56                                            'singular_label' => __('Revision'), 
    5457                                            'public' => false, 
    5558                                            '_builtin' => true, 
     
    713716 * Optional $args contents: 
    714717 * 
    715  * label - A descriptive name for the post type marked for translation. Defaults to $post_type. 
     718 * label - A (plural) descriptive name for the post type marked for translation. Defaults to $post_type. 
     719 * singular_label - A (singular) descriptive name for the post type marked for translation. Defaults to $label. 
    716720 * description - A short descriptive summary of what the post type is. Defaults to blank. 
    717721 * public - Whether posts of this type should be shown in the admin UI. Defaults to false. 
     
    747751 
    748752    // 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 ); 
     753    $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 ); 
    750754    $args = wp_parse_args($args, $defaults); 
    751755    $args = (object) $args; 
     
    768772    if ( false === $args->label ) 
    769773        $args->label = $post_type; 
     774 
     775    if ( false === $args->singular_label ) 
     776        $args->singular_label = $args->label; 
    770777 
    771778    if ( empty($args->capability_type) ) 
Note: See TracChangeset for help on using the changeset viewer.