When accessing the Customizer from the admin menu, make sure the user is returned to the originating page upon close. We should still investigate the general usage of customize-loader.js moving forward, but this approach fixes the immediate issue. props westonruter. fixes #25457.

git-svn-id: https://develop.svn.wordpress.org/trunk@29026 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi
2014-07-08 17:14:20 +00:00
parent 0298f71032
commit c722aca8e5
2 changed files with 15 additions and 7 deletions
+9 -5
View File
@@ -12,16 +12,20 @@ define( 'IFRAME_REQUEST', true );
/** Load WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
if ( ! current_user_can( 'edit_theme_options' ) )
if ( ! current_user_can( 'edit_theme_options' ) ) {
wp_die( __( 'Cheatin’ uh?' ) );
}
wp_reset_vars( array( 'url', 'return' ) );
$url = urldecode( $url );
$url = wp_unslash( $url );
$url = wp_validate_redirect( $url, home_url( '/' ) );
if ( $return )
$return = wp_validate_redirect( urldecode( $return ) );
if ( ! $return )
if ( $return ) {
$return = wp_unslash( $return );
$return = wp_validate_redirect( $return );
}
if ( ! $return ) {
$return = $url;
}
global $wp_scripts, $wp_customize;