wp_ajax_update_welcome_panel

The timeline below displays how wordpress function wp_ajax_update_welcome_panel has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.3

/**
 * Handles updating whether to display the welcome panel via AJAX.
 *
 * @since 3.1.0
 */
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);
}

WordPress Version: 4.0

/**
 * Ajax handler for updating whether to display the welcome panel.
 *
 * @since 3.1.0
 */
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);
}

WordPress Version: 3.7

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);
}