HTTP/2 301
server: nginx
date: Fri, 26 Dec 2025 11:27:13 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/classes/wp_theme/is_allowed/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
HTTP/2 200
server: nginx
date: Fri, 26 Dec 2025 11:27:14 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 1
WP_Theme::is_allowed() – Method | Developer.WordPress.org
WP_Theme::is_allowed( string $check = 'both', int $blog_id = null ): bool
Determines whether the theme is allowed (multisite only).
$checkstringoptionalWhether to check only the 'network'-wide settings, the 'site' settings, or 'both'. Defaults to 'both'.
Default:'both'
$blog_idintoptionalIgnored if only network-wide settings are checked. Defaults to current site.
Default:null
bool Whether the theme is allowed for the network. Returns true in single-site.
public function is_allowed( $check = 'both', $blog_id = null ) {
if ( ! is_multisite() ) {
return true;
}
if ( 'both' === $check || 'network' === $check ) {
$allowed = self::get_allowed_on_network();
if ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {
return true;
}
}
if ( 'both' === $check || 'site' === $check ) {
$allowed = self::get_allowed_on_site( $blog_id );
if ( ! empty( $allowed[ $this->get_stylesheet() ] ) ) {
return true;
}
}
return false;
}
View all references View on Trac View on GitHub
| Version | Description |
|---|
| 3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.