Rename wp_save_nav_menu_item to wp_save_nav_menu_items. Though it could handle one item, it expects a mess of post data containing an array of menu items. see #13447.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
253c82d9b7
commit
b4c50f1b5e
|
@ -829,7 +829,7 @@ case 'add-menu-item' :
|
||||||
|
|
||||||
$menu_id = (int) $_POST['menu'];
|
$menu_id = (int) $_POST['menu'];
|
||||||
if ( isset( $_POST['menu-item'] ) ) {
|
if ( isset( $_POST['menu-item'] ) ) {
|
||||||
$item_ids = wp_save_nav_menu_item( $menu_id, $_POST['menu-item'] );
|
$item_ids = wp_save_nav_menu_items( $menu_id, $_POST['menu-item'] );
|
||||||
if ( is_wp_error( $item_ids ) )
|
if ( is_wp_error( $item_ids ) )
|
||||||
die('-1');
|
die('-1');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -863,7 +863,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
|
||||||
* @param array $menu_data The unsanitized posted menu item data.
|
* @param array $menu_data The unsanitized posted menu item data.
|
||||||
* @return array The database IDs of the items saved
|
* @return array The database IDs of the items saved
|
||||||
*/
|
*/
|
||||||
function wp_save_nav_menu_item( $menu_id = 0, $menu_data = array() ) {
|
function wp_save_nav_menu_items( $menu_id = 0, $menu_data = array() ) {
|
||||||
$menu_id = (int) $menu_id;
|
$menu_id = (int) $menu_id;
|
||||||
$items_saved = array();
|
$items_saved = array();
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ switch ( $action ) {
|
||||||
if ( isset( $_REQUEST['nav-menu-locations'] ) )
|
if ( isset( $_REQUEST['nav-menu-locations'] ) )
|
||||||
set_theme_mod( 'nav_menu_locations', $_REQUEST['menu-locations'] );
|
set_theme_mod( 'nav_menu_locations', $_REQUEST['menu-locations'] );
|
||||||
elseif ( isset( $_REQUEST['menu-item'] ) )
|
elseif ( isset( $_REQUEST['menu-item'] ) )
|
||||||
wp_save_nav_menu_item( $nav_menu_selected_id, $_REQUEST['menu-item'] );
|
wp_save_nav_menu_items( $nav_menu_selected_id, $_REQUEST['menu-item'] );
|
||||||
break;
|
break;
|
||||||
case 'move-down-menu-item' :
|
case 'move-down-menu-item' :
|
||||||
// moving down a menu item is the same as moving up the next in order
|
// moving down a menu item is the same as moving up the next in order
|
||||||
|
|
Loading…
Reference in New Issue