get_allowed_themes

Definition:
function get_allowed_themes() {}

Get the allowed themes for the current blog.

Return values

returns:Array of allowed themes.

Defined filters

  • allowed_themes
    apply_filters("allowed_themes", get_site_allowed_themes()

Source code

function get_allowed_themes() {

	if ( !is_multisite() )

		return get_themes();



	$themes = get_themes();

	$ct = current_theme_info();

	$allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() );

	if ( $allowed_themes == false )

		$allowed_themes = array();



	$blog_allowed_themes = wpmu_get_blog_allowedthemes();

	if ( is_array( $blog_allowed_themes ) )

		$allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );



	if ( isset( $allowed_themes[ esc_html( $ct->stylesheet ) ] ) == false )

		$allowed_themes[ esc_html( $ct->stylesheet ) ] = true;



	reset( $themes );

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

		if ( isset( $allowed_themes[ esc_html( $theme[ 'Stylesheet' ] ) ] ) == false )

			unset( $themes[ $key ] );

	}

	reset( $themes );



	return $themes;

}

1134

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 )

Facebook photo

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

Connecting to %s

%d bloggers like this: