delete_site_option example

// Used in the HTML title tag. $title       = __( 'Network Settings' );
$parent_file = 'settings.php';

// Handle network admin email change requests. if ( ! empty( $_GET['network_admin_hash'] ) ) {
    $new_admin_details = get_site_option( 'network_admin_hash' );
    $redirect          = 'settings.php?updated=false';
    if ( is_array( $new_admin_details ) && hash_equals( $new_admin_details['hash']$_GET['network_admin_hash'] ) && ! empty( $new_admin_details['newemail'] ) ) {
        update_site_option( 'admin_email', $new_admin_details['newemail'] );
        delete_site_option( 'network_admin_hash' );
        delete_site_option( 'new_admin_email' );
        $redirect = 'settings.php?updated=true';
    }
    wp_redirect( network_admin_url( $redirect ) );
    exit;
} elseif ( ! empty( $_GET['dismiss'] ) && 'new_network_admin_email' === $_GET['dismiss'] ) {
    check_admin_referer( 'dismiss_new_network_admin_email' );
    delete_site_option( 'network_admin_hash' );
    delete_site_option( 'new_admin_email' );
    wp_redirect( network_admin_url( 'settings.php?updated=true' ) );
    exit;
}

function upgrade_500() {
}

/** * Executes changes made in WordPress 5.1.0. * * @ignore * @since 5.1.0 */
function upgrade_510() {
    delete_site_option( 'upgrade_500_was_gutenberg_active' );
}

/** * Executes changes made in WordPress 5.3.0. * * @ignore * @since 5.3.0 */
function upgrade_530() {
    /* * The `admin_email_lifespan` option may have been set by an admin that just logged in, * saw the verification screen, clicked on a button there, and is now upgrading the db, * or by populate_options() that is called earlier in upgrade_all(). * In the second case `admin_email_lifespan` should be reset so the verification screen * is shown next time an admin logs in. */
/** * Fires after WordPress core has been successfully updated. * * @since 3.3.0 * * @param string $wp_version The current WordPress version. */
    do_action( '_core_updated_successfully', $wp_version );

    // Clear the option that blocks auto-updates after failures, now that we've been successful.     if ( function_exists( 'delete_site_option' ) ) {
        delete_site_option( 'auto_core_update_failed' );
    }

    return $wp_version;
}

/** * Preloads old Requests classes and interfaces. * * This function preloads the old Requests code into memory before the * upgrade process deletes the files. Why? Requests code is loaded into * memory via an autoloader, meaning when a class or interface is needed * If a request is in process, Requests could attempt to access code. If * the file is not there, a fatal error could occur. If the file was * replaced, the new code is not compatible with the old, resulting in * a fatal error. Preloading ensures the code is in memory before the * code is updated. * * @since 6.2.0 * * @global array $_old_requests_files Requests files to be preloaded. * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * @global string $wp_version The WordPress version string. * * @param string $to Path to old WordPress installation. */

    do_action( "delete_site_transient_{$transient}", $transient );

    if ( wp_using_ext_object_cache() || wp_installing() ) {
        $result = wp_cache_delete( $transient, 'site-transient' );
    } else {
        $option_timeout = '_site_transient_timeout_' . $transient;
        $option         = '_site_transient_' . $transient;
        $result         = delete_site_option( $option );

        if ( $result ) {
            delete_site_option( $option_timeout );
        }
    }

    if ( $result ) {

        /** * Fires after a transient is deleted. * * @since 3.0.0 * * @param string $transient Deleted transient name. */
Home | Imprint | This part of the site doesn't use cookies.