WP_Theme::network_disable_theme

Advertisement

Summery Summery

Disables a theme for all sites on the current network.

Syntax Syntax

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

Parameters Parameters

$stylesheets

(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 ) {
			if ( isset( $allowed_themes[ $stylesheet ] ) ) {
				unset( $allowed_themes[ $stylesheet ] );
			}
		}

		update_site_option( 'allowedthemes', $allowed_themes );
	}

	/**
	 * Sorts themes by name.
	 *
	 * @since 3.4.0
	 *
	 * @param WP_Theme[] $themes Array of theme objects to sort (passed by reference).
	 */
	public static function sort_by_name( &$themes ) {

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

Advertisement

Leave a Reply