Changeset 31421
- Timestamp:
- 02/11/2015 10:12:47 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-customize-manager.php
r31370 r31421 141 141 */ 142 142 protected function wp_die( $ajax_message, $message = null ) { 143 if ( $this->doing_ajax() )143 if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) { 144 144 wp_die( $ajax_message ); 145 146 if ( ! $message ) 145 } 146 147 if ( ! $message ) { 147 148 $message = __( 'Cheatin’ uh?' ); 149 } 148 150 149 151 wp_die( $message ); … … 158 160 */ 159 161 public function wp_die_handler() { 160 if ( $this->doing_ajax() )162 if ( $this->doing_ajax() || isset( $_POST['customized'] ) ) { 161 163 return '_ajax_wp_die_handler'; 164 } 162 165 163 166 return '_default_wp_die_handler'; … … 174 177 send_origin_headers(); 175 178 176 if ( is_admin() && ! $this->doing_ajax() ) 177 auth_redirect(); 178 elseif ( $this->doing_ajax() && ! is_user_logged_in() ) 179 $this->wp_die( 0 ); 179 $doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_POST['customized'] ) ); 180 if ( is_admin() && ! $doing_ajax_or_is_customized ) { 181 auth_redirect(); 182 } elseif ( $doing_ajax_or_is_customized && ! is_user_logged_in() ) { 183 $this->wp_die( 0 ); 184 } 180 185 181 186 show_admin_bar( false ); … … 195 200 // If the requested theme is not the active theme and the user doesn't have the 196 201 // switch_themes cap, bail. 197 if ( ! current_user_can( 'switch_themes' ) ) 202 if ( ! current_user_can( 'switch_themes' ) ) { 198 203 $this->wp_die( -1 ); 204 } 199 205 200 206 // If the theme has errors while loading, bail. 201 if ( $this->theme()->errors() ) 207 if ( $this->theme()->errors() ) { 202 208 $this->wp_die( -1 ); 209 } 203 210 204 211 // If the theme isn't allowed per multisite settings, bail. 205 if ( ! $this->theme()->is_allowed() ) 212 if ( ! $this->theme()->is_allowed() ) { 206 213 $this->wp_die( -1 ); 214 } 207 215 } 208 216 … … 216 224 */ 217 225 public function after_setup_theme() { 218 if ( ! $this->doing_ajax() && ! validate_current_theme() ) { 226 $doing_ajax_or_is_customized = ( $this->doing_ajax() || isset( $_SERVER['customized'] ) ); 227 if ( ! $doing_ajax_or_is_customized && ! validate_current_theme() ) { 219 228 wp_redirect( 'themes.php?broken=true' ); 220 229 exit; … … 230 239 public function start_previewing_theme() { 231 240 // Bail if we're already previewing. 232 if ( $this->is_preview() ) 241 if ( $this->is_preview() ) { 233 242 return; 243 } 234 244 235 245 $this->previewing = true; … … 267 277 */ 268 278 public function stop_previewing_theme() { 269 if ( ! $this->is_preview() ) 279 if ( ! $this->is_preview() ) { 270 280 return; 281 } 271 282 272 283 $this->previewing = false;
Note: See TracChangeset
for help on using the changeset viewer.