Summery Summery
Whether the theme is allowed (multisite only).
Syntax Syntax
Parameters Parameters
- $check
-
(Optional) Whether to check only the 'network'-wide settings, the 'site' settings, or 'both'. Defaults to 'both'.
Default value: 'both'
- $blog_id
-
(Optional) Ignored if only network-wide settings are checked. Defaults to current site.
Default value: null
Return Return
(bool) Whether the theme is allowed for the network. Returns true in single-site.
Source Source
File: wp-includes/class-wp-theme.php
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; } /** * Determines the latest WordPress default theme that is installed. * * This hits the filesystem.
Advertisement
Changelog Changelog
Version | Description |
---|---|
3.4.0 | Introduced. |