WP_Theme::get_allowed() WordPress Method

The WP_Theme::get_allowed() method is used to retrieve a list of allowed tags and attributes for a given context. This is useful for making sure that your theme or plugin output is properly formatted and safe for display on a WordPress site.

WP_Theme::get_allowed( int $blog_id = null ) #

Returns array of stylesheet names of themes allowed on the site or network.


Parameters

$blog_id

(int)(Optional) ID of the site. Defaults to the current site.

Default value: null


Top ↑

Return

(string[]) Array of stylesheet names.


Top ↑

Source

File: wp-includes/class-wp-theme.php

	public static function get_allowed( $blog_id = null ) {
		/**
		 * Filters the array of themes allowed on the network.
		 *
		 * Site is provided as context so that a list of network allowed themes can
		 * be filtered further.
		 *
		 * @since 4.5.0
		 *
		 * @param string[] $allowed_themes An array of theme stylesheet names.
		 * @param int      $blog_id        ID of the site.
		 */
		$network = (array) apply_filters( 'network_allowed_themes', self::get_allowed_on_network(), $blog_id );
		return $network + self::get_allowed_on_site( $blog_id );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.