wppaste
WordPress

apply_filters( 'site_allowed_themes', string[] $allowed_themes, int $blog_id )

Since
4.5.0
Filters the array of themes allowed on the site.

Compatibility

WordPress
since 4.5.0
  • 6.7.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

Parameters

$allowed_themesstring[]
An array of theme stylesheet names.
$blog_idint
ID of the site. Defaults to current site.

Where this hook fires · 2

  • wp-includes/class-wp-theme.php:1729WP_Theme::get_allowed_on_site()
  • wp-includes/class-wp-theme.php:1782WP_Theme::get_allowed_on_site()

Source code

			 *			 * @since 4.5.0			 *			 * @param string[] $allowed_themes An array of theme stylesheet names.			 * @param int      $blog_id        ID of the site. Defaults to current site.			 */			return (array) apply_filters( 'site_allowed_themes', $allowed_themes[ $blog_id ], $blog_id );		} 		$current = get_current_blog_id() === $blog_id; 		if ( $current ) {			$allowed_themes[ $blog_id ] = get_option( 'allowedthemes' );

Changelog

Introduced in 4.5.0. Unchanged from 6.7.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.