wp_ajax_menu_locations_save
Ajax handler for menu locations save.
Description
wp_ajax_menu_locations_save();
Usage
if ( !function_exists( 'wp_ajax_menu_locations_save' ) ) { require_once ABSPATH . '/wp-admin/includes/ajax-actions.php'; } // NOTICE! Understand what this does before running. $result = wp_ajax_menu_locations_save();
Defined (1)
The function is defined in the following location(s).
- /wp-admin/includes/ajax-actions.php
- function wp_ajax_menu_locations_save() {
- if ( ! current_user_can( 'edit_theme_options' ) )
- wp_die( -1 );
- check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' );
- if ( ! isset( $_POST['menu-locations'] ) )
- wp_die( 0 );
- set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
- wp_die( 1 );
- }