WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/25/2010 04:49:57 PM (10 years ago)
Author:
ryan
Message:

Set meta after new menu is inserted. see #11817

File:
1 edited

Legend:

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

    r13397 r13400  
    120120            'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'nav_menu' => $menu_title ),
    121121            'post_content' => $custom_description, 'post_title' => $custom_title );
    122         if ( $new_window )
    123             update_post_meta( $db_id, 'menu_new_window', 1 );
    124         else
    125             update_post_meta( $db_id, 'menu_new_window', 0 );
     122
    126123        if ( $parent_id > 0 && isset( $parent_menu_ids[$parent_id] ) )
    127124            $post['post_parent'] = $parent_menu_ids[$parent_id];
    128 
    129         if ( $custom_linkurl )
    130             update_post_meta( $db_id, 'menu_link', esc_url_raw( $custom_linkurl ) );
    131125
    132126        // New menu item
     
    142136        update_post_meta( $db_id, 'menu_type', $linktype );
    143137        update_post_meta( $db_id, 'object_id', $object_id );
     138        if ( $new_window )
     139            update_post_meta( $db_id, 'menu_new_window', 1 );
     140        else
     141            update_post_meta( $db_id, 'menu_new_window', 0 );
     142        if ( $custom_linkurl )
     143            update_post_meta( $db_id, 'menu_link', esc_url_raw( $custom_linkurl ) );
     144
    144145    }
    145146    if ( !empty( $menu_items ) ) {
Note: See TracChangeset for help on using the changeset viewer.