wp_ajax_menu_locations_save

Ajax handler for menu locations save.

Description

wp_ajax_menu_locations_save(); 

Usage

  1. if ( !function_exists( 'wp_ajax_menu_locations_save' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/ajax-actions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_ajax_menu_locations_save(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/ajax-actions.php  
  1. function wp_ajax_menu_locations_save() { 
  2. if ( ! current_user_can( 'edit_theme_options' ) ) 
  3. wp_die( -1 ); 
  4. check_ajax_referer( 'add-menu_item', 'menu-settings-column-nonce' ); 
  5. if ( ! isset( $_POST['menu-locations'] ) ) 
  6. wp_die( 0 ); 
  7. set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) ); 
  8. wp_die( 1 );