get_site_option example


function wp_get_user_contact_methods( $user = null ) {
    $methods = array();
    if ( get_site_option( 'initial_db_version' ) < 23588 ) {
        $methods = array(
            'aim'    => __( 'AIM' ),
            'yim'    => __( 'Yahoo IM' ),
            'jabber' => __( 'Jabber / Google Talk' ),
        );
    }

    /** * Filters the user contact methods. * * @since 2.9.0 * * @param string[] $methods Array of contact method labels keyed by contact method. * @param WP_User|null $user WP_User object or null if none was provided. */
wp_redirect( admin_url( 'themes.php?deleted=true' ) );
        }
        exit;
    } elseif ( 'enable-auto-update' === $_GET['action'] ) {
        if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) {
            wp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ) );
        }

        check_admin_referer( 'updates' );

        $all_items    = wp_get_themes();
        $auto_updates = (array) get_site_option( 'auto_update_themes', array() );

        $auto_updates[] = $_GET['stylesheet'];
        $auto_updates   = array_unique( $auto_updates );
        // Remove themes that have been deleted since the site option was last updated.         $auto_updates = array_intersect( $auto_updatesarray_keys( $all_items ) );

        update_site_option( 'auto_update_themes', $auto_updates );

        wp_redirect( admin_url( 'themes.php?enabled-auto-update=true' ) );

        exit;
    }

function _upgrade_core_deactivate_incompatible_plugins() {
    if ( defined( 'GUTENBERG_VERSION' ) && version_compare( GUTENBERG_VERSION, '14.1', '<' ) ) {
        $deactivated_gutenberg['gutenberg'] = array(
            'plugin_name'         => 'Gutenberg',
            'version_deactivated' => GUTENBERG_VERSION,
            'version_compatible'  => '14.1',
        );
        if ( is_plugin_active_for_network( 'gutenberg/gutenberg.php' ) ) {
            $deactivated_plugins = get_site_option( 'wp_force_deactivated_plugins', array() );
            $deactivated_plugins = array_merge( $deactivated_plugins$deactivated_gutenberg );
            update_site_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
        } else {
            $deactivated_plugins = get_option( 'wp_force_deactivated_plugins', array() );
            $deactivated_plugins = array_merge( $deactivated_plugins$deactivated_gutenberg );
            update_option( 'wp_force_deactivated_plugins', $deactivated_plugins );
        }
        deactivate_plugins( array( 'gutenberg/gutenberg.php' ), true );
    }
}

    }

    /** * Checks if automatic updates have tried to run, but failed, previously. * * @since 5.2.0 * * @return array|false The test results. False if the auto-updates failed. */
    public function test_if_failed_update() {
        $failed = get_site_option( 'auto_core_update_failed' );

        if ( ! $failed ) {
            return false;
        }

        if ( ! empty( $failed['critical'] ) ) {
            $description  = __( 'A previous automatic background update ended with a critical failure, so updates are now disabled.' );
            $description .= ' ' . __( 'You would have received an email because of this.' );
            $description .= ' ' . __( "When you've been able to update using the \"Update now\" button on Dashboard > Updates, this error will be cleared for future update attempts." );
            $description .= ' ' . sprintf(
                /* translators: %s: Code of error shown. */
                

function get_core_updates( $options = array() ) {
    $options = array_merge(
        array(
            'available' => true,
            'dismissed' => false,
        ),
        $options
    );

    $dismissed = get_site_option( 'dismissed_update_core' );

    if ( ! is_array( $dismissed ) ) {
        $dismissed = array();
    }

    $from_api = get_site_transient( 'update_core' );

    if ( ! isset( $from_api->updates ) || ! is_array( $from_api->updates ) ) {
        return false;
    }

    
'put your unique phrase here',
                /* * translators: This string should only be translated if wp-config-sample.php is localized. * You can check the localized release package or * https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php */
                __( 'put your unique phrase here' ),
            )
        );

        if ( ! defined( 'AUTH_KEY' ) || in_array( AUTH_KEY, $default_keys, true ) ) {
            $auth_key = get_site_option( 'recovery_mode_auth_key' );

            if ( ! $auth_key ) {
                if ( ! function_exists( 'wp_generate_password' ) ) {
                    require_once ABSPATH . WPINC . '/pluggable.php';
                }

                $auth_key = wp_generate_password( 64, true, true );
                update_site_option( 'recovery_mode_auth_key', $auth_key );
            }
        } else {
            $auth_key = AUTH_KEY;
        }
$extensions = get_loaded_extensions();
    sort( $extensions, SORT_STRING | SORT_FLAG_CASE );
    $query = array(
        'version'            => $wp_version,
        'php'                => $php_version,
        'locale'             => $locale,
        'mysql'              => $mysql_version,
        'local_package'      => isset( $wp_local_package ) ? $wp_local_package : '',
        'blogs'              => $num_blogs,
        'users'              => get_user_count(),
        'multisite_enabled'  => $multisite_enabled,
        'initial_db_version' => get_site_option( 'initial_db_version' ),
        'extensions'         => array_combine( $extensionsarray_map( 'phpversion', $extensions ) ),
        'platform_flags'     => array(
            'os'   => PHP_OS,
            'bits' => PHP_INT_SIZE === 4 ? 32 : 64,
        ),
        'image_support'      => array(),
    );

    if ( function_exists( 'gd_info' ) ) {
        $gd_info = gd_info();
        // Filter to supported values.
check_admin_referer( 'updates' );
            } else {
                if ( empty( $_POST['checked'] ) ) {
                    // Nothing to do.                     wp_safe_redirect( add_query_arg( 'error', 'none', $referer ) );
                    exit;
                }

                check_admin_referer( 'bulk-themes' );
            }

            $auto_updates = (array) get_site_option( 'auto_update_themes', array() );

            if ( 'enable-auto-update' === $action ) {
                $auto_updates[] = $_GET['theme'];
                $auto_updates   = array_unique( $auto_updates );
                $referer        = add_query_arg( 'enabled-auto-update', 1, $referer );
            } elseif ( 'disable-auto-update' === $action ) {
                $auto_updates = array_diff( $auto_updates, array( $_GET['theme'] ) );
                $referer      = add_query_arg( 'disabled-auto-update', 1, $referer );
            } else {
                // Bulk enable/disable.                 $themes = (array) wp_unslash( $_POST['checked'] );

                

function is_plugin_active_for_network( $plugin ) {
    if ( ! is_multisite() ) {
        return false;
    }

    $plugins = get_site_option( 'active_sitewide_plugins' );
    if ( isset( $plugins[ $plugin ] ) ) {
        return true;
    }

    return false;
}

/** * Checks for "Network: true" in the plugin header to see if this should * be activated only as a network wide plugin. The plugin would also work * when Multisite is not enabled. * * Checks for "Site Wide Only: true" for backward compatibility. * * @since 3.0.0 * * @param string $plugin Path to the plugin file relative to the plugins directory. * @return bool True if plugin is network only, false otherwise. */

        if ( 'auth' === $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) {
            $values['salt'] = SECRET_SALT;
        }

        if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ), true ) ) {
            foreach ( array( 'key', 'salt' ) as $type ) {
                $const = strtoupper( "{$scheme}_{$type});
                if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {
                    $values[ $type ] = constant( $const );
                } elseif ( ! $values[ $type ] ) {
                    $values[ $type ] = get_site_option( "{$scheme}_{$type});
                    if ( ! $values[ $type ] ) {
                        $values[ $type ] = wp_generate_password( 64, true, true );
                        update_site_option( "{$scheme}_{$type}", $values[ $type ] );
                    }
                }
            }
        } else {
            if ( ! $values['key'] ) {
                $values['key'] = get_site_option( 'secret_key' );
                if ( ! $values['key'] ) {
                    $values['key'] = wp_generate_password( 64, true, true );
                    

$allowed_options['misc']    = array();
$allowed_options['options'] = array();
$allowed_options['privacy'] = array();

$mail_options = array( 'mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass' );

if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ), true ) ) {
    $allowed_options['reading'][] = 'blog_charset';
}

if ( get_site_option( 'initial_db_version' ) < 32453 ) {
    $allowed_options['writing'][] = 'use_smilies';
    $allowed_options['writing'][] = 'use_balanceTags';
}

if ( ! is_multisite() ) {
    if ( ! defined( 'WP_SITEURL' ) ) {
        $allowed_options['general'][] = 'siteurl';
    }
    if ( ! defined( 'WP_HOME' ) ) {
        $allowed_options['general'][] = 'home';
    }

    

function get_dashboard_blog() {
    _deprecated_function( __FUNCTION__, '3.1.0', 'get_site()' );
    if ( $blog = get_site_option( 'dashboard_blog' ) ) {
        return get_site( $blog );
    }

    return get_site( get_network()->site_id );
}

/** * Generates a random password. * * @since MU (3.0.0) * @deprecated 3.0.0 Use wp_generate_password() * @see wp_generate_password() * * @param int $len Optional. The length of password to generate. Default 8. */
<?php
/** Sets up the WordPress Environment. */
require __DIR__ . '/wp-load.php';

add_filter( 'wp_robots', 'wp_robots_no_robots' );

require __DIR__ . '/wp-blog-header.php';

nocache_headers();

if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new']get_site_option( 'illegal_names' ), true ) ) {
    wp_redirect( network_home_url() );
    die();
}

/** * Prints signup_header via wp_head. * * @since MU (3.0.0) */
function do_signup_header() {
    /** * Fires within the head section of the site sign-up screen. * * @since 3.0.0 */

                                    ?> </select> </td> </tr> <?php endif; // End if ! IS_PROFILE_PAGE. ?> <?php if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) : ?> <tr class="user-super-admin-wrap"> <th><?php _e( 'Super Admin' ); ?></th> <td> <?php if ( 0 !== strcasecmp( $profile_user->user_email, get_site_option( 'admin_email' ) ) || ! is_super_admin( $profile_user->ID ) ) : ?> <p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profile_user->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p> <?php else : ?> <p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p> <?php endif; ?> </td> </tr> <?php endif; ?> <tr class="user-first-name-wrap"> <th><label for="first_name"><?php _e( 'First Name' ); ?></label></th> <td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profile_user->first_name ); ?>" class="regular-text" /></td> </tr> <tr class="user-last-name-wrap"> <th><label for="last_name">
'count'       => 1,
            )
        );
        $cat_tt_id = $wpdb->insert_id;

        // First post.         $now             = current_time( 'mysql' );
        $now_gmt         = current_time( 'mysql', 1 );
        $first_post_guid = get_option( 'home' ) . '/?p=1';

        if ( is_multisite() ) {
            $first_post = get_site_option( 'first_post' );

            if ( ! $first_post ) {
                $first_post = "<!-- wp:paragraph -->\n<p>" .
                /* translators: First post content. %s: Site link. */
                __( 'Welcome to %s. This is your first post. Edit or delete it, then start writing!' ) .
                "</p>\n<!-- /wp:paragraph -->";
            }

            $first_post = sprintf(
                $first_post,
                sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() )get_network()->site_name )
            );
Home | Imprint | This part of the site doesn't use cookies.