Title: WP_Theme::network_enable_theme
Published: August 16, 2016
Last modified: April 28, 2025

---

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

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#wp--skip-link--target)

Enables a theme for all sites on the current network.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#parameters)󠁿

 `$stylesheets`string|string[]required

Stylesheet name or array of stylesheet names.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#source)󠁿

    ```php
    public static function network_enable_theme( $stylesheets ) {
    	if ( ! is_multisite() ) {
    		return;
    	}

    	if ( ! is_array( $stylesheets ) ) {
    		$stylesheets = array( $stylesheets );
    	}

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

    	update_site_option( 'allowedthemes', $allowed_themes );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-theme.php#L2067)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-theme.php#L2067-L2082)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#related)󠁿

| Uses | Description | 
| [update_site_option()](https://developer.wordpress.org/reference/functions/update_site_option/)`wp-includes/option.php` |

Updates the value of an option that was already added for the current network.

  | 
| [is_multisite()](https://developer.wordpress.org/reference/functions/is_multisite/)`wp-includes/load.php` |

Determines whether Multisite is enabled.

  | 
| [get_site_option()](https://developer.wordpress.org/reference/functions/get_site_option/)`wp-includes/option.php` |

Retrieve an option value for the current network based on name of option.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_theme/network_enable_theme/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.6.0](https://developer.wordpress.org/reference/since/4.6.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_theme%2Fnetwork_enable_theme%2F)
before being able to contribute a note or feedback.