get_allowed_on_network example


    public function is_allowed( $check = 'both', $blog_id = null ) {
        if ( ! is_multisite() ) {
            return true;
        }

        if ( 'both' === $check || 'network' === $check ) {
            $allowed = self::get_allowed_on_network();
            if ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {
                return true;
            }
        }

        if ( 'both' === $check || 'site' === $check ) {
            $allowed = self::get_allowed_on_site( $blog_id );
            if ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {
                return true;
            }
        }

        
$theme_directories[ $current_theme ]['theme_root'] = $root_of_current_theme;
        }
    }

    if ( empty( $theme_directories ) ) {
        return array();
    }

    if ( is_multisite() && null !== $args['allowed'] ) {
        $allowed = $args['allowed'];
        if ( 'network' === $allowed ) {
            $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_network() );
        } elseif ( 'site' === $allowed ) {
            $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_site( $args['blog_id'] ) );
        } elseif ( $allowed ) {
            $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );
        } else {
            $theme_directories = array_diff_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) );
        }
    }

    $themes         = array();
    static $_themes = array();

    
return is_network_only_plugin( $file );
}

/** * Deprecated functionality for getting themes network-enabled themes. * * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_network() * @see WP_Theme::get_allowed_on_network() */
function get_site_allowed_themes() {
    _deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_network()' );
    return array_map( 'intval', WP_Theme::get_allowed_on_network() );
}

/** * Deprecated functionality for getting themes allowed on a specific site. * * @deprecated 3.4.0 Use WP_Theme::get_allowed_on_site() * @see WP_Theme::get_allowed_on_site() */
function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {
    _deprecated_function( __FUNCTION__, '3.4.0', 'WP_Theme::get_allowed_on_site()' );
    return array_map( 'intval', WP_Theme::get_allowed_on_site( $blog_id ) );
}
Home | Imprint | This part of the site doesn't use cookies.