Advertisements

wpmu_get_blog_allowedthemes

Definition:
function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {}

Parameters

  • $blog_id

Source code

function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {

	$themes = get_themes();



	if ( $blog_id != 0 )

		switch_to_blog( $blog_id );



	$blog_allowed_themes = get_option( 'allowedthemes' );

	if ( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes

		$blog_allowed_themes = get_option( 'allowed_themes' );



		if ( is_array( $blog_allowed_themes ) ) {

			foreach( (array) $themes as $key => $theme ) {

				$theme_key = esc_html( $theme['Stylesheet'] );

				if ( isset( $blog_allowed_themes[$key] ) == true ) {

					$blog_allowedthemes[$theme_key] = 1;

				}

			}

			$blog_allowed_themes = $blog_allowedthemes;

			add_option( 'allowedthemes', $blog_allowed_themes );

			delete_option( 'allowed_themes' );

		}

	}



	if ( $blog_id != 0 )

		restore_current_blog();



	return $blog_allowed_themes;

}

3385

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: