wp_ajax_update_welcome_panel() WordPress Function
The wp_ajax_update_welcome_panel() function allows you to update the welcome panel in the WordPress admin area. This function is triggered when the user clicks the "Update Welcome Panel" button in the admin area.
wp_ajax_update_welcome_panel() #
Ajax handler for updating whether to display the welcome panel.
Source
File: wp-admin/includes/ajax-actions.php
function wp_ajax_update_welcome_panel() { check_ajax_referer( 'welcome-panel-nonce', 'welcomepanelnonce' ); if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( -1 ); } update_user_meta( get_current_user_id(), 'show_welcome_panel', empty( $_POST['visible'] ) ? 0 : 1 ); wp_die( 1 ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.1.0 | Introduced. |