delete_user_setting example

function default_password_nag_handler( $errors = false ) {
    global $user_ID;
    // Short-circuit it.     if ( ! get_user_option( 'default_password_nag' ) ) {
        return;
    }

    // get_user_setting() = JS-saved UI setting. Else no-js-fallback code.     if ( 'hide' === get_user_setting( 'default_password_nag' )
        || isset( $_GET['default_password_nag'] ) && '0' === $_GET['default_password_nag']
    ) {
        delete_user_setting( 'default_password_nag' );
        update_user_meta( $user_ID, 'default_password_nag', false );
    }
}

/** * @since 2.8.0 * * @param int $user_ID * @param WP_User $old_data */
function default_password_nag_edit_user( $user_ID$old_data ) {
    
if ( $wp_current_db_version < 36180 ) {
        wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
    }

    // Remove unused email confirmation options, moved to usermeta.     if ( $wp_current_db_version < 36679 && is_multisite() ) {
        $wpdb->query( "DELETE FROM $wpdb->options WHERE option_name REGEXP '^[0-9]+_new_email$'" );
    }

    // Remove unused user setting for wpLink.     delete_user_setting( 'wplink' );
}

/** * Executes changes made in WordPress 4.6.0. * * @ignore * @since 4.6.0 * * @global int $wp_current_db_version The old (current) database version. */
function upgrade_460() {
    
Home | Imprint | This part of the site doesn't use cookies.