Make WordPress Core

Changeset 15056


Ignore:
Timestamp:
05/29/2010 04:46:46 PM (13 years ago)
Author:
nacin
Message:

Use show_in_nav_menus for attachments. Also add it to register_taxonomy for consistency and have it default to public, not show_ui, like post types. see #13621.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/nav-menu.php

    r15049 r15056  
    387387 */
    388388function wp_nav_menu_taxonomy_meta_boxes() {
    389     $taxonomies = get_taxonomies( array( 'show_ui' => true ), 'object' );
     389    $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' );
    390390
    391391    if ( !$taxonomies )
     
    953953function _wp_nav_menu_meta_box_object( $object = null ) {
    954954    if ( isset( $object->name ) ) {
    955         // don't show media meta box
    956         if ( 'attachment' == $object->name )
    957             return false;
    958955
    959956        if ( 'page' == $object->name ) {
  • trunk/wp-includes/post.php

    r14991 r15056  
    5151        'query_var' => false,
    5252        'can_export' => false,
     53        'show_in_nav_menus' => false,
    5354    ) );
    5455
  • trunk/wp-includes/taxonomy.php

    r14934 r15056  
    4646        'show_ui' => false,
    4747        '_builtin' => true,
     48        'show_in_nav_menus' => false,
    4849    ) ) ;
    4950
     
    233234 * defaults to public.
    234235 *
     236 * show_in_nav_menus - true makes this taxonomy available for selection in navigation menus.
     237 * Defaults to public.
     238 *
    235239 * show_tagcloud - false to prevent the taxonomy being listed in the Tag Cloud Widget;
    236240 * defaults to show_ui which defalts to public.
     
    265269                        'labels' => array(),
    266270                        'capabilities' => array(),
     271                        'show_in_nav_menus' => null,
    267272                    );
    268273    $args = wp_parse_args($args, $defaults);
     
    286291    if ( is_null($args['show_ui']) )
    287292        $args['show_ui'] = $args['public'];
     293
     294    // Whether to show this type in nav-menus.php. Defaults to the setting for public.
     295    if ( null === $args['show_in_nav_menus'] )
     296        $args['show_in_nav_menus'] = $args['public'];
    288297
    289298    if ( is_null($args['show_tagcloud']) )
Note: See TracChangeset for help on using the changeset viewer.