Changeset 18261
- Timestamp:
- 06/11/2011 02:20:18 AM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/admin-bar.php
r18254 r18261 239 239 function wp_admin_bar_new_content_menu( $wp_admin_bar ) { 240 240 $actions = array(); 241 foreach ( (array) get_post_types( array( 'show_ ui' => true ), 'objects' ) as $ptype_obj ) {242 if ( true !== $ptype_obj->show_in_menu ||! current_user_can( $ptype_obj->cap->edit_posts ) )241 foreach ( (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' ) as $ptype_obj ) { 242 if ( ! current_user_can( $ptype_obj->cap->edit_posts ) ) 243 243 continue; 244 244 245 $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels-> singular_name, $ptype_obj->cap->edit_posts, 'new-' . $ptype_obj->name );245 $actions[ 'post-new.php?post_type=' . $ptype_obj->name ] = array( $ptype_obj->labels->name_admin_bar, $ptype_obj->cap->edit_posts, 'new-' . $ptype_obj->name ); 246 246 } 247 247 -
trunk/wp-includes/post.php
r18234 r18261 19 19 function create_initial_post_types() { 20 20 register_post_type( 'post', array( 21 'labels' => array( 22 'name_admin_bar' => _x( 'Post', 'add new on admin bar' ), 23 ), 21 24 'public' => true, 22 25 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ … … 31 34 32 35 register_post_type( 'page', array( 36 'labels' => array( 37 'name_admin_bar' => _x( 'Page', 'add new on admin bar' ), 38 ), 33 39 'public' => true, 34 40 'publicly_queryable' => false, … … 916 922 'supports' => array(), 'register_meta_box_cb' => null, 917 923 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 918 'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 'show_in_nav_menus' => null, 'show_in_menu' => null, 924 'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 925 'show_in_nav_menus' => null, 'show_in_menu' => null, 'show_in_admin_bar' => null, 919 926 ); 920 927 $args = wp_parse_args($args, $defaults); … … 938 945 if ( null === $args->show_in_menu || ! $args->show_ui ) 939 946 $args->show_in_menu = $args->show_ui; 947 948 // If not set, default to the whether the full UI is shown. 949 if ( null === $args->show_in_admin_bar ) 950 $args->show_in_admin_bar = true === $args->show_in_menu; 940 951 941 952 // Whether to show this type in nav-menus.php. Defaults to the setting for public. … … 1194 1205 if ( !isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) 1195 1206 $object->labels['singular_name'] = $object->labels['name']; 1207 1208 if ( ! isset( $object->labels['name_admin_bar'] ) ) 1209 $object->labels['name_admin_bar'] = isset( $object->labels['singular_name'] ) ? $object->labels['singular_name'] : $object->name; 1196 1210 1197 1211 if ( !isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) )
Note: See TracChangeset
for help on using the changeset viewer.