Changeset 37202 for trunk/src/wp-admin/network/themes.php
- Timestamp:
- 04/14/2016 03:39:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/themes.php
r36770 r37202 30 30 31 31 if ( $action ) { 32 $allowed_themes = get_site_option( 'allowedthemes' );33 32 switch ( $action ) { 34 33 case 'enable': 35 34 check_admin_referer('enable-theme_' . $_GET['theme']); 36 $allowed_themes[ $_GET['theme'] ] = true; 37 update_site_option( 'allowedthemes', $allowed_themes ); 35 WP_Theme::network_enable_theme( $_GET['theme'] ); 38 36 if ( false === strpos( $referer, '/network/themes.php' ) ) 39 37 wp_redirect( network_admin_url( 'themes.php?enabled=1' ) ); … … 43 41 case 'disable': 44 42 check_admin_referer('disable-theme_' . $_GET['theme']); 45 unset( $allowed_themes[ $_GET['theme'] ] ); 46 update_site_option( 'allowedthemes', $allowed_themes ); 43 WP_Theme::network_disable_theme( $_GET['theme'] ); 47 44 wp_safe_redirect( add_query_arg( 'disabled', '1', $referer ) ); 48 45 exit; … … 54 51 exit; 55 52 } 56 foreach ( (array) $themes as $theme ) 57 $allowed_themes[ $theme ] = true; 58 update_site_option( 'allowedthemes', $allowed_themes ); 53 WP_Theme::network_enable_theme( (array) $themes ); 59 54 wp_safe_redirect( add_query_arg( 'enabled', count( $themes ), $referer ) ); 60 55 exit; … … 66 61 exit; 67 62 } 68 foreach ( (array) $themes as $theme ) 69 unset( $allowed_themes[ $theme ] ); 70 update_site_option( 'allowedthemes', $allowed_themes ); 63 WP_Theme::network_disable_theme( (array) $themes ); 71 64 wp_safe_redirect( add_query_arg( 'disabled', count( $themes ), $referer ) ); 72 65 exit;
Note: See TracChangeset
for help on using the changeset viewer.