Changeset 17137
- Timestamp:
- 12/25/2010 08:19:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network/site-themes.php
r17134 r17137 40 40 41 41 // Clean up request URI from temporary args for screen options/paging uri's to work as expected. 42 $_SERVER['REQUEST_URI'] = remove_query_arg(array('enable', 'disable', 'enable-selected', 'disable-selected'), $_SERVER['REQUEST_URI']); 42 $temp_args = array( 'enabled', 'disabled', 'deleted', 'error', 'enabled', 'disabled', 'deleted', 'error' ); 43 $_SERVER['REQUEST_URI'] = remove_query_arg( $temp_args, $_SERVER['REQUEST_URI'] ); 44 $referer = remove_query_arg( $temp_args, wp_get_referer() ); 43 45 44 46 $id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0; … … 63 65 check_admin_referer( 'enable-theme_' . $_GET['theme'] ); 64 66 $theme = $_GET['theme']; 65 $update = 'enabled'; 67 $action = 'enabled'; 68 $n = 1; 66 69 if ( !$allowed_themes ) 67 70 $allowed_themes = array( $theme => true ); … … 72 75 check_admin_referer( 'disable-theme_' . $_GET['theme'] ); 73 76 $theme = $_GET['theme']; 74 $update = 'disabled'; 77 $action = 'disabled'; 78 $n = 1; 75 79 if ( !$allowed_themes ) 76 80 $allowed_themes = array(); … … 81 85 check_admin_referer( 'bulk-themes' ); 82 86 if ( isset( $_POST['checked'] ) ) { 83 $update = 'enable';84 87 $themes = (array) $_POST['checked']; 88 $action = 'enabled'; 89 $n = count( $themes ); 85 90 foreach( (array) $themes as $theme ) 86 91 $allowed_themes[ $theme ] = true; 87 92 } else { 88 $update = 'error'; 93 $action = 'error'; 94 $n = 'none'; 89 95 } 90 96 break; … … 92 98 check_admin_referer( 'bulk-themes' ); 93 99 if ( isset( $_POST['checked'] ) ) { 94 $update = 'disable';95 100 $themes = (array) $_POST['checked']; 101 $action = 'disabled'; 102 $n = count( $themes ); 96 103 foreach( (array) $themes as $theme ) 97 104 unset( $allowed_themes[ $theme ] ); 98 105 } else { 99 $update = 'error'; 106 $action = 'error'; 107 $n = 'none'; 100 108 } 101 109 break; … … 105 113 restore_current_blog(); 106 114 107 wp_redirect( add_query_arg( 'update', $update, wp_get_referer()) );115 wp_redirect( add_query_arg( $action, $n, $referer ) ); 108 116 exit; 109 117 } 110 118 111 119 if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) { 112 wp_redirect( wp_get_referer());120 wp_redirect( $referer ); 113 121 exit(); 114 122 } … … 141 149 </h3><?php 142 150 143 if ( isset( $_GET['update'] ) ) { 144 switch ( $_GET['update'] ) { 145 case 'enabled': 146 echo '<div id="message" class="updated"><p>' . __( 'Theme enabled.' ) . '</p></div>'; 147 break; 148 case 'disabled': 149 echo '<div id="message" class="updated"><p>' . __( 'Theme disabled.' ) . '</p></div>'; 150 break; 151 case 'error': 152 echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>'; 153 break; 154 } 151 if ( isset( $_GET['enabled'] ) ) { 152 $_GET['enabled'] = absint( $_GET['enabled'] ); 153 echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>'; 154 } elseif ( isset( $_GET['disabled'] ) ) { 155 $_GET['disabled'] = absint( $_GET['disabled'] ); 156 echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>'; 157 } elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) { 158 echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>'; 155 159 } ?> 156 160
Note: See TracChangeset
for help on using the changeset viewer.