get_site_allowed_themes

Definition:
function get_site_allowed_themes() {}

Source code

function get_site_allowed_themes() {

	$themes = get_themes();

	$allowed_themes = get_site_option( 'allowedthemes' );

	if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) {

		$allowed_themes = get_site_option( 'allowed_themes' ); // convert old allowed_themes format

		if ( !is_array( $allowed_themes ) ) {

			$allowed_themes = array();

		} else {

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

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

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

					$allowedthemes[ $theme_key ] = 1;

				}

			}

			$allowed_themes = $allowedthemes;

		}

	}

	return $allowed_themes;

}

1695

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: