Determines whether the theme is allowed (multisite only).
Parameters
$checkstringoptional- Whether to check only the
'network'-wide settings, the'site'settings, or'both'. Defaults to'both'.Default:
'both' $blog_idintoptional- Ignored if only network-wide settings are checked. Defaults to current site.
Default:
null
Source
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;
}
Changelog
| Version | Description |
|---|---|
| 3.4.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.