ms_is_switched example


function update_home_siteurl( $old_value$value ) {
    if ( wp_installing() ) {
        return;
    }

    if ( is_multisite() && ms_is_switched() ) {
        delete_option( 'rewrite_rules' );
    } else {
        flush_rewrite_rules();
    }
}


/** * Resets global variables based on $_GET and $_POST. * * This function resets global variables based on the names passed * in the $vars array to the value of $_POST[$var] or $_GET[$var] or '' * if neither is defined. * * @since 2.0.0 * * @param array $vars An array of globals to reset. */


            if ( defined( 'MULTISITE' ) ) {
                $ms_dir = '/sites/' . get_current_blog_id();
            } else {
                $ms_dir = '/' . get_current_blog_id();
            }

            $dir .= $ms_dir;
            $url .= $ms_dir;

        } elseif ( defined( 'UPLOADS' ) && ! ms_is_switched() ) {
            /* * Handle the old-form ms-files.php rewriting if the network still has that enabled. * When ms-files rewriting is enabled, then we only listen to UPLOADS when: * 1) We are not on the main site in a post-MU network, as wp-content/uploads is used * there, and * 2) We are not switched, as ms_upload_constants() hardcodes these constants to reflect * the original blog ID. * * Rather than UPLOADS, we actually use BLOGUPLOADDIR if it is set, as it is absolute. * (And it will be set, see ms_upload_constants().) Otherwise, UPLOADS can be used, as * as it is relative to ABSPATH. For the final piece: when UPLOADS is used with ms-files * rewriting in multisite, the resulting URL is /files. (#WP22702 for background.) */
Home | Imprint | This part of the site doesn't use cookies.