Changeset 13261
- Timestamp:
- 02/20/2010 10:44:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-navigation.php
r13257 r13261 156 156 if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; } 157 157 158 $post = array( 'post_status' => ' menu-' . $linktype, 'post_type' => 'menu_item', 'post_author' => $user_ID,159 'ping_status' => 0, 'post_parent' => $post_id, ' menu_order' => $position,158 $post = array( 'post_status' => 'publish', 'post_type' => 'menu_item', 'post_author' => $user_ID, 159 'ping_status' => 0, 'post_parent' => $post_id, '`menu_order' => $position, 160 160 'guid' => $custom_linkurl, 'post_excerpt' => $custom_anchor_title, 'tax_input' => array( 'menu' => $menu_title ), 161 161 'post_content' => $custom_description, 'post_title' => $custom_title ); … … 167 167 //New menu item 168 168 if ($db_id == 0) { 169 $ post_id = wp_insert_post( $post );169 $db_id = $post_id = wp_insert_post( $post ); 170 170 } elseif ( isset( $menu_items[$db_id] ) ) { 171 171 foreach( $update_fields as $field ) { 172 172 if ( $post[$field] != $menu_items[$db_id]->$field ) { 173 173 $post['ID'] = $db_id; 174 wp_ insert_post( $post );174 wp_update_post( $post ); 175 175 break; 176 176 } … … 178 178 unset( $menu_items[$db_id] ); 179 179 } 180 update_post_meta($db_id, 'menu_type', $linktype); 180 181 } 181 182 if ( !empty( $menu_items ) ) {
Note: See TracChangeset
for help on using the changeset viewer.