get_blog_option example


    }

    // Populate the site's options.     populate_options(
        array_merge(
            array(
                'home'        => untrailingslashit( $home_scheme . '://' . $site->domain . $site->path ),
                'siteurl'     => untrailingslashit( $siteurl_scheme . '://' . $site->domain . $site->path ),
                'blogname'    => wp_unslash( $args['title'] ),
                'admin_email' => '',
                'upload_path' => get_network_option( $network->id, 'ms_files_rewriting' ) ? UPLOADBLOGSDIR . "/{$site->id}/files" : get_blog_option( $network->site_id, 'upload_path' ),
                'blog_public' => (int) $site->public,
                'WPLANG'      => get_network_option( $network->id, 'WPLANG' ),
            ),
            $args['options']
        )
    );

    // Clean blog cache after populating options.     clean_blog_cache( $site );

    // Populate the site's roles.
$this->column_cb( $item );

                    echo '</th>';
                    break;

                case 'name':
                    $active_theme_label = '';

                    /* The presence of the site_id property means that this is a subsite view and a label for the active theme needs to be added */
                    if ( ! empty( $this->site_id ) ) {
                        $stylesheet = get_blog_option( $this->site_id, 'stylesheet' );
                        $template   = get_blog_option( $this->site_id, 'template' );

                        /* Add a label for the active template */
                        if ( $item->get_template() === $template ) {
                            $active_theme_label = ' &mdash; ' . __( 'Active Theme' );
                        }

                        /* In case this is a child theme, label it properly */
                        if ( $stylesheet !== $template && $item->get_stylesheet() === $stylesheet ) {
                            $active_theme_label = ' &mdash; ' . __( 'Active Child Theme' );
                        }
                    }

function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) {
    if ( empty( $path ) ) {
        $path = '/';
    }

    $path = '/' . ltrim( $path, '/' );

    if ( is_multisite() && get_blog_option( $blog_id, 'permalink_structure' ) || get_option( 'permalink_structure' ) ) {
        global $wp_rewrite;

        if ( $wp_rewrite->using_index_permalinks() ) {
            $url = get_home_url( $blog_id$wp_rewrite->index . '/' . rest_get_url_prefix()$scheme );
        } else {
            $url = get_home_url( $blog_idrest_get_url_prefix()$scheme );
        }

        $url .= $path;
    } else {
        $url = trailingslashit( get_home_url( $blog_id, '', $scheme ) );
        
$message = sprintf(
        /* translators: New site notification email. 1: User login, 2: Site URL, 3: Site title. */
        __(
            'New site created by %1$s Address: %2$s Name: %3$s'
        ),
        $user->user_login,
        get_site_url( $site->id ),
        get_blog_option( $site->id, 'blogname' )
    );

    $header = sprintf(
        'From: "%1$s" <%2$s>',
        _x( 'Site Admin', 'email "From" field' ),
        $email
    );

    $new_site_email = array(
        'to'      => $email,
        'subject' => $subject,
        
if ( 'https' === parse_url( get_home_url( get_network()->site_id ), PHP_URL_SCHEME ) ) {
            $home = set_url_scheme( $home, 'https' );
        }
    }

    update_option( 'siteurl', $siteurl );
    update_option( 'home', $home );

    if ( get_site_option( 'ms_files_rewriting' ) ) {
        update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" );
    } else {
        update_option( 'upload_path', get_blog_option( get_network()->site_id, 'upload_path' ) );
    }

    update_option( 'blogname', wp_unslash( $blog_title ) );
    update_option( 'admin_email', '' );

    // Remove all permissions.     $table_prefix = $wpdb->get_blog_prefix();
    delete_metadata( 'user', 0, $table_prefix . 'user_level', null, true );   // Delete all.     delete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // Delete all. }


    protected function get_roles_data() {
        global $wp_user_roles;

        if ( ! empty( $wp_user_roles ) ) {
            return $wp_user_roles;
        }

        if ( is_multisite() && get_current_blog_id() != $this->site_id ) {
            remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 );

            $roles = get_blog_option( $this->site_id, $this->role_key, array() );

            add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 );

            return $roles;
        }

        return get_option( $this->role_key, array() );
    }
}
Home | Imprint | This part of the site doesn't use cookies.