WordPress.org

Make WordPress Core

Changeset 13722


Ignore:
Timestamp:
03/16/2010 10:01:49 PM (12 years ago)
Author:
ryan
Message:

Menu item -> append should be a key/name, not a label. see #11817

Location:
trunk
Files:
3 edited

Legend:

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

    r13716 r13722  
    2222        if ( !in_array($post_type->name, $allowed_types) )
    2323            continue;
    24         $id = sanitize_title_with_dashes( $post_type->label );
    25        
     24        $id = $post_type->name;
     25
    2626        // delete_transient( "nav_menu_items_{$post_type->name}" );
    2727        // delete_transient( "nav_menu_sub_items_{$post_type->name}" );
     
    3838function wp_nav_menu_taxonomy_metaboxes() {
    3939    $taxonomies = get_taxonomies( array( 'show_ui' => true ), 'object' );
    40    
     40
    4141    if ( !$taxonomies )
    4242        return false;
     
    4646        if ( !in_array($tax->name, $allowed_types) )
    4747            continue;
    48         $id = sanitize_title_with_dashes( $tax->label );
    49 
    50        
     48        $id = $tax->name;
     49
    5150        // delete_transient( "nav_menu_items_{$tax->name}" );
    5251        // delete_transient( "nav_menu_sub_items_{$tax->name}" );
    53        
     52
    5453        add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'menus', 'side', 'default', $tax );
    5554    }
     
    183182    }
    184183   
    185     $id = sanitize_title_with_dashes( $post_type['args']->label );
     184    $id = $post_type['args']->name;
    186185    ?>
    187186    <p class="quick-search-wrap">
     
    198197        <div class="list-container">
    199198            <ul class="list">
    200                 <?php echo isset( $error ) ? $error : wp_nav_menu_get_items( $query->posts, 'post_type', $post_type['args']->name ); ?>
     199                <?php echo isset( $error ) ? $error : wp_nav_menu_get_items( $query->posts, 'post_type', $id ); ?>
    201200            </ul>
    202201        </div><!-- /.list-container-->
     
    205204        <a class="button-secondary"><?php _e('Add to Menu'); ?></a>
    206205    </p>
    207     <input type="hidden" class="autocomplete" name="autocomplete-<?php echo esc_attr( $post_type['args']->name ); ?>-names" value="<?php echo esc_js( $pt_names ); ?>" />
     206    <input type="hidden" class="autocomplete" name="autocomplete-<?php echo esc_attr( $id ); ?>-names" value="<?php echo esc_js( $pt_names ); ?>" />
    208207    <br class="clear" />
    209208    <script type="text/javascript" charset="utf-8">
     
    253252    }
    254253   
    255     $id = sanitize_title_with_dashes( $taxonomy['args']->label );
     254    $id = $taxonomy['args']->name;
    256255    ?>
    257256    <p class="quick-search-wrap">
     
    268267        <div class="list-container">
    269268            <ul class="list">
    270                 <?php echo isset( $error ) ? $error : wp_nav_menu_get_items( $terms, 'taxonomy', $taxonomy['args']->name ); ?>
     269                <?php echo isset( $error ) ? $error : wp_nav_menu_get_items( $terms, 'taxonomy', $id ); ?>
    271270            </ul>
    272271        </div><!-- /.list-container-->
     
    275274        <a class="button-secondary"><?php _e('Add to Menu'); ?></a>
    276275    </p>
    277     <input type="hidden" class="autocomplete" name="autocomplete-<?php echo esc_attr($taxonomy['args']->name); ?>-names" value="<?php echo esc_js( $term_names ); ?>" />
     276    <input type="hidden" class="autocomplete" name="autocomplete-<?php echo esc_attr($id); ?>-names" value="<?php echo esc_js( $term_names ); ?>" />
    278277    <br class="clear" />
    279278    <script type="text/javascript" charset="utf-8">
  • trunk/wp-includes/nav-menu-template.php

    r13704 r13722  
    117117        $menu_item = wp_setup_nav_menu_item( $menu_item, 'frontend' );
    118118
    119         $type = sanitize_title_with_dashes( $menu_item->append );
     119        $type = $menu_item->append;
    120120        $maybe_value = 'frontend' == $args->context ? '' : ' value="'. $menu_item->ID .'"';
    121121        $classes = 'frontend' == $args->context ? ' class="menu-item-type-'. $type . $menu_item->li_class .'"' : '';
  • trunk/wp-includes/nav-menu.php

    r13719 r13722  
    172172            $menu_item->parent_id = (int) $menu_item->post_parent;
    173173            $menu_item->type = get_post_meta( $menu_item->ID, 'menu_item_type', true );
    174             $menu_item->append = _x( get_post_meta( $menu_item->ID, 'menu_item_append', true ), 'nav menu item type' );
     174
     175            $menu_item->append = get_post_meta( $menu_item->ID, 'menu_item_append', true );
    175176           
    176177            $menu_item->title = $menu_item->post_title;
     
    191192            $menu_item->parent_id = (int) $menu_item->post_parent;
    192193            $menu_item->type = 'custom'; //$menu_item_type
    193             $menu_item->append = _x( 'Custom', 'nav menu item type' );
     194            $menu_item->append = 'custom';
    194195           
    195196            $menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
     
    208209           
    209210            $object = get_post_type_object( $menu_item_object );
    210             $menu_item->append = _x( $object->singular_label, 'nav menu item type' );
     211            $menu_item->append = $object->name;
    211212
    212213            $menu_item->title = $menu_item->post_title;
     
    226227           
    227228            $object = get_taxonomy( $menu_item_object );
    228             $menu_item->append = _x( $object->singular_label, 'nav menu item type' );
     229            $menu_item->append = $object->name;
    229230
    230231            $menu_item->title = $menu_item->name;
     
    235236            break;
    236237    }
    237    
     238
    238239    $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );
    239240    $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true );
Note: See TracChangeset for help on using the changeset viewer.