Make WordPress Core

Changeset 14270


Ignore:
Timestamp:
04/28/2010 04:56:50 AM (16 years ago)
Author:
nacin
Message:

Give menu items a default 'draft' state when added to the menu. props filosofo, fixes #13149

File:
1 edited

Legend:

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

    r14263 r14270  
    245245                'post_excerpt' => $args['menu-item-attr-title'],
    246246                'post_parent' => $args['menu-item-parent-id'],
    247                 'post_status' => 'publish',
    248247                'post_title' => $args['menu-item-title'],
    249248                'post_type' => 'nav_menu_item',
     
    254253        if ( 0 == $menu_item_db_id ) {
    255254                $post['ID'] = 0;
     255                $post['post_status'] = 'draft';
    256256                $menu_item_db_id = wp_insert_post( $post );
    257257
     
    259259        } else {
    260260                $post['ID'] = $menu_item_db_id;
     261                $post['post_status'] = 'publish';
    261262                wp_update_post( $post );
    262263        }
Note: See TracChangeset for help on using the changeset viewer.