wpseek.com
WordPress开发者和主题制作者的搜索引擎
wp_ajax_menu_locations_save › WordPress Function
Since3.1.0
已弃用n/a
› wp_ajax_menu_locations_save ( 没有参数 )
| 定义在: |
|
| 文档: |
Handles saving menu locations via AJAX.
源码
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 );
}