Changeset 16606 for trunk/wp-admin/network/site-themes.php
- Timestamp:
- 11/29/2010 07:24:54 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network/site-themes.php
r16592 r16606 44 44 case 'enable': 45 45 $theme = $_GET['theme']; 46 $update = 'enabled'; 46 47 if ( !$allowed_themes ) 47 48 $allowed_themes = array( $theme => true ); … … 51 52 case 'disable': 52 53 $theme = $_GET['theme']; 54 $update = 'disabled'; 53 55 if ( !$allowed_themes ) 54 56 $allowed_themes = array(); … … 57 59 break; 58 60 case 'enable-selected': 59 $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();60 if ( empty($themes) ) {61 restore_current_blog();62 wp_redirect( wp_get_referer() );63 exit;64 } 65 foreach( (array) $themes as $theme )66 $allowed_themes[ $theme ] = true;61 if ( isset( $_POST['checked'] ) ) { 62 $update = 'enable'; 63 $themes = (array) $_POST['checked']; 64 foreach( (array) $themes as $theme ) 65 $allowed_themes[ $theme ] = true; 66 } else { 67 $update = 'error'; 68 } 67 69 break; 68 70 case 'disable-selected': 69 $themes = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array();70 if ( empty($themes) ) {71 restore_current_blog();72 wp_redirect( wp_get_referer() );73 exit;74 } 75 foreach( (array) $themes as $theme )76 unset( $allowed_themes[ $theme ] );71 if ( isset( $_POST['checked'] ) ) { 72 $update = 'disable'; 73 $themes = (array) $_POST['checked']; 74 foreach( (array) $themes as $theme ) 75 unset( $allowed_themes[ $theme ] ); 76 } else { 77 $update = 'error'; 78 } 77 79 break; 78 80 } … … 81 83 restore_current_blog(); 82 84 83 wp_redirect( wp_get_referer() ); // @todo add_query_arg for update message85 wp_redirect( add_query_arg( 'update', $update, wp_get_referer() ) ); 84 86 exit; 85 87 } … … 111 113 } 112 114 ?> 113 </h3> 115 </h3><?php 116 117 if ( isset( $_GET['update'] ) ) { 118 switch ( $_GET['update'] ) { 119 case 'enabled': 120 echo '<div id="message" class="updated"><p>' . __( 'Theme enabled.' ) . '</p></div>'; 121 break; 122 case 'disabled': 123 echo '<div id="message" class="updated"><p>' . __( 'Theme disabled.' ) . '</p></div>'; 124 break; 125 case 'error': 126 echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>'; 127 break; 128 } 129 } ?> 130 114 131 <p><?php _e( 'Network enabled themes are not shown on this screen.' ) ?></p> 115 132
Note: See TracChangeset
for help on using the changeset viewer.