WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/03/2010 10:52:30 PM (10 years ago)
Author:
nacin
Message:

Don't use target="_self" in nav menu links, just omit the attribute. Also fix and run earlier db upgrades. fixes #12808

File:
1 edited

Legend:

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

    r13897 r13974  
    155155    switch ( $context ) {
    156156        case 'frontend':
    157             $attributes  = ( isset($menu_item->attr_title) && '' != $menu_item->attr_title ) ? ' title="'. esc_attr($menu_item->attr_title) .'"' : '';
    158             $attributes .= ( isset($menu_item->target) && '' != $menu_item->target ) ? ' target="'. esc_attr($menu_item->target) .'"' : '';
    159             $attributes .= ( isset($menu_item->xfn) && '' != $menu_item->xfn ) ? ' rel="'. esc_attr($menu_item->xfn) .'"' : '';
    160             $attributes .= ( isset($menu_item->url) && '' != $menu_item->url ) ? ' href="'. esc_attr($menu_item->url) .'"' : '';
     157            $attributes  = ! empty( $menu_item->attr_title ) ? ' title="'  . esc_attr( $menu_item->attr_title ) .'"' : '';
     158            $attributes .= ! empty( $menu_item->target )     ? ' target="' . esc_attr( $menu_item->target     ) .'"' : '';
     159            $attributes .= ! empty( $menu_item->xfn )        ? ' rel="'    . esc_attr( $menu_item->xfn        ) .'"' : '';
     160            $attributes .= ! empty( $menu_item->url )        ? ' href="'   . esc_attr( $menu_item->url        ) .'"' : '';
    161161
    162162            $output .= esc_html( $args->before );
Note: See TracChangeset for help on using the changeset viewer.