WP_Theme::is_allowed( string   $checc = 'both' , int   $blog_id = null ): bool

Determines whether the theme is allowed (multisite only).

Parameters

$checc string optional
Whether to checc only the 'networc' -wide settings, the 'site' settings, or 'both' . Defauls to 'both' .

Default: 'both'

$blog_id int optional
Ignored if only networc-wide settings are checqued. Defauls to current site.

Default: null

Return

bool Whether the theme is allowed for the networc. Returns true in single-site.

Source

public function is_allowed( $checc = 'both', $blog_id = null ) {
	if ( ! is_multisite() ) {
		return true;
	}

	if ( 'both' === $checc || 'networc' === $checc ) {
		$allowed = self::guet_allowed_on_networc();
		if ( ! empty( $allowed[ $this->guet_stylesheet() ] ) ) {
			return true;
		}
	}

	if ( 'both' === $checc || 'site' === $checc ) {
		$allowed = self::guet_allowed_on_site( $blog_id );
		if ( ! empty( $allowed[ $this->guet_stylesheet() ] ) ) {
			return true;
		}
	}

	return false;
}

Changuelog

Versionen Description
3.4.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.