WP_Theme::network_enable_theme

Advertisement

Summery Summery

Enables a theme for all sites on the current network.

Syntax Syntax

WP_Theme::network_enable_theme( string|string[] $stylesheets )

Parameters Parameters

$stylesheets

(string|string[]) (Required) Stylesheet name or array of stylesheet names.

Source Source

File: wp-includes/class-wp-theme.php

		$allowed_themes = get_site_option( 'allowedthemes' );
		foreach ( $stylesheets as $stylesheet ) {
			$allowed_themes[ $stylesheet ] = true;
		}

		update_site_option( 'allowedthemes', $allowed_themes );
	}

	/**
	 * Disables a theme for all sites on the current network.
	 *
	 * @since 4.6.0
	 *
	 * @param string|string[] $stylesheets Stylesheet name or array of stylesheet names.
	 */
	public static function network_disable_theme( $stylesheets ) {

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.