diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php
index b6bd757..132ff47 100644
a
|
b
|
function wp_ajax_edit_comment() { |
1149 | 1149 | function wp_ajax_add_menu_item() { |
1150 | 1150 | check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' ); |
1151 | 1151 | |
1152 | | if ( ! current_user_can( 'edit_theme_options' ) ) |
| 1152 | if ( ! current_user_can( 'edit_theme_options' ) or ! isset( $_POST['menu'] ) ) |
1153 | 1153 | wp_die( -1 ); |
1154 | 1154 | |
1155 | 1155 | require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; |
… |
… |
function wp_ajax_add_menu_item() { |
1157 | 1157 | // For performance reasons, we omit some object properties from the checklist. |
1158 | 1158 | // The following is a hacky way to restore them when adding non-custom items. |
1159 | 1159 | |
| 1160 | $menu_id = (int) $_POST['menu']; |
1160 | 1161 | $menu_items_data = array(); |
1161 | 1162 | foreach ( (array) $_POST['menu-item'] as $menu_item_data ) { |
1162 | 1163 | if ( |
… |
… |
function wp_ajax_add_menu_item() { |
1188 | 1189 | $menu_items_data[] = $menu_item_data; |
1189 | 1190 | } |
1190 | 1191 | |
1191 | | $item_ids = wp_save_nav_menu_items( 0, $menu_items_data ); |
| 1192 | $item_ids = wp_save_nav_menu_items( $menu_id, $menu_items_data ); |
1192 | 1193 | if ( is_wp_error( $item_ids ) ) |
1193 | 1194 | wp_die( 0 ); |
1194 | 1195 | |