mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user