WordPress.org

Make WordPress Core

Changeset 13731


Ignore:
Timestamp:
03/17/2010 04:18:41 PM (11 years ago)
Author:
ryan
Message:

Fix menu item type labels. see #11817

File:
1 edited

Legend:

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

    r13725 r13731  
    193193            $output .= '<span class="item-title">'. esc_html($menu_item->title) .'</span>';
    194194            $output .= '<span class="item-controls">';
    195             $output .= '<span class="item-type">'. esc_html($menu_item->append) .'</span>';
     195            if ( 'custom' == $menu_item->type ) {
     196                $label = __('Custom');
     197            } elseif ( 'post_type' == $menu_item->type ) {
     198                $type_obj = get_post_type_object($menu_item->append);
     199                $label = $type_obj->singular_label;
     200            } elseif ( 'taxonomy' == $menu_item->type ) {
     201                $taxonomy = get_taxonomy($menu_item->append);
     202                $label = $taxonomy->singular_label;
     203            } else {
     204                $label = $menu_item->append;
     205            }
     206            $output .= '<span class="item-type">'. esc_html($label) .'</span>';
    196207           
    197208            // Actions
Note: See TracChangeset for help on using the changeset viewer.