default_password_nag_edit_user

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

WordPress Version: 6.3

/**
 * @since 2.8.0
 *
 * @param int     $user_ID
 * @param WP_User $old_data
 */
function default_password_nag_edit_user($user_ID, $old_data)
{
    // Short-circuit it.
    if (!get_user_option('default_password_nag', $user_ID)) {
        return;
    }
    $new_data = get_userdata($user_ID);
    // Remove the nag if the password has been changed.
    if ($new_data->user_pass !== $old_data->user_pass) {
        delete_user_setting('default_password_nag');
        update_user_meta($user_ID, 'default_password_nag', false);
    }
}

WordPress Version: 5.8

/**
 * @since 2.8.0
 *
 * @param int     $user_ID
 * @param WP_User $old_data
 */
function default_password_nag_edit_user($user_ID, $old_data)
{
    // Short-circuit it.
    if (!get_user_option('default_password_nag', $user_ID)) {
        return;
    }
    $new_data = get_userdata($user_ID);
    // Remove the nag if the password has been changed.
    if ($new_data->user_pass != $old_data->user_pass) {
        delete_user_setting('default_password_nag');
        update_user_meta($user_ID, 'default_password_nag', false);
    }
}

WordPress Version: 5.6

/**
 * @since 2.8.0
 *
 * @param int     $user_ID
 * @param WP_User $old_data
 */
function default_password_nag_edit_user($user_ID, $old_data)
{
    // Short-circuit it.
    if (!get_user_option('default_password_nag', $user_ID)) {
        return;
    }
    $new_data = get_userdata($user_ID);
    // Remove the nag if the password has been changed.
    if ($new_data->user_pass != $old_data->user_pass) {
        delete_user_setting('default_password_nag');
        update_user_option($user_ID, 'default_password_nag', false, true);
    }
}

WordPress Version: 4.3

/**
 * @since 2.8.0
 *
 * @param int    $user_ID
 * @param object $old_data
 */
function default_password_nag_edit_user($user_ID, $old_data)
{
    // Short-circuit it.
    if (!get_user_option('default_password_nag', $user_ID)) {
        return;
    }
    $new_data = get_userdata($user_ID);
    // Remove the nag if the password has been changed.
    if ($new_data->user_pass != $old_data->user_pass) {
        delete_user_setting('default_password_nag');
        update_user_option($user_ID, 'default_password_nag', false, true);
    }
}

WordPress Version: 4.0

/**
 * @since 2.8.0
 */
function default_password_nag_edit_user($user_ID, $old_data)
{
    // Short-circuit it.
    if (!get_user_option('default_password_nag', $user_ID)) {
        return;
    }
    $new_data = get_userdata($user_ID);
    // Remove the nag if the password has been changed.
    if ($new_data->user_pass != $old_data->user_pass) {
        delete_user_setting('default_password_nag');
        update_user_option($user_ID, 'default_password_nag', false, true);
    }
}

WordPress Version: 3.7

/**
 * @since 2.8.0
 */
function default_password_nag_edit_user($user_ID, $old_data)
{
    if (!get_user_option('default_password_nag', $user_ID)) {
        //Short circuit it.
        return;
    }
    $new_data = get_userdata($user_ID);
    if ($new_data->user_pass != $old_data->user_pass) {
        //Remove the nag if the password has been changed.
        delete_user_setting('default_password_nag');
        update_user_option($user_ID, 'default_password_nag', false, true);
    }
}