Changeset 14619
- Timestamp:
- 05/14/2010 02:13:49 AM (14 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r14614 r14619 772 772 * Optional $args contents: 773 773 * 774 * - label - Name of the post type shown in the menu. Usually plural. If not set, labels['name'] will be used. 774 775 * - description - A short descriptive summary of what the post type is. Defaults to blank. 775 776 * - public - Whether posts of this type should be shown in the admin UI. Defaults to false. … … 870 871 871 872 $args->labels = get_post_type_labels( $args ); 872 873 // we keep these two only for backwards compatibility874 // TODO: remove in 3.1875 873 $args->label = $args->labels->name; 876 $args->singular_label = $args->labels->singular_name;877 874 878 875 $wp_post_types[$post_type] = $args; … … 921 918 * 922 919 * Accepted keys of the label array in the post type object: 923 * - name - general name for the post type, usually plural. Default is Posts/Pages920 * - name - general name for the post type, usually plural. The same and overriden by $post_type_object->label. Default is Posts/Pages 924 921 * - singular_name - name for one object of this post type. Default is Post/Page 925 922 * - add_new - Default is Add New for both hierarchical and non-hierarchical types. When internationalizing this string, please use a {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context gettext context} matching your post type. Example: <code>_x('Add New', 'product');</code> … … 966 963 function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) { 967 964 968 // try to get missing (singular_)?name from older style (singular_)?label member variables 969 // we keep that for backwards compatibility 970 // TODO: remove in 3.1 971 if ( !isset( $object->labels['name'] ) && isset( $object->label ) ) { 965 if ( isset( $object->label ) ) { 972 966 $object->labels['name'] = $object->label; 973 }974 if ( !isset( $object->labels['singular_name'] ) && isset( $object->singular_label ) ) {975 $object->labels['singular_name'] = $object->singular_label;976 967 } 977 968 -
trunk/wp-includes/taxonomy.php
r14614 r14619 211 211 * 212 212 * Optional $args contents: 213 * 214 * label - Name of the taxonomy shown in the menu. Usually plural. If not set, labels['name'] will be used. 213 215 * 214 216 * hierarchical - has some defined purpose at other parts of the API and is a … … 298 300 $args['name'] = $taxonomy; 299 301 $args['object_type'] = (array) $object_type; 302 300 303 $args['labels'] = get_taxonomy_labels( (object) $args ); 301 302 // we keep these two only for backwards compatibility303 // TODO: remove in 3.1304 304 $args['label'] = $args['labels']->name; 305 $args['singular_label'] = $args['labels']->singular_name;306 305 307 306 $wp_taxonomies[$taxonomy] = (object) $args; … … 315 314 * 316 315 * Accepted keys of the label array in the taxonomy object: 317 * - name - general name for the taxonomy, usually plural. Default is Post Tags/Categories316 * - name - general name for the taxonomy, usually plural. The same as and overriden by $tax->label. Default is Post Tags/Categories 318 317 * - singular_name - name for one object of this taxonomy. Default is Post Tag/Category 319 318 * - search_items - Default is Search Tags/Search Categories
Note: See TracChangeset
for help on using the changeset viewer.