diff --git src/wp-admin/customize.php src/wp-admin/customize.php
index 29ae035..7e69d13 100644
|
|
|
define( 'IFRAME_REQUEST', true );
|
| 12 | 12 | /** Load WordPress Administration Bootstrap */ |
| 13 | 13 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
| 14 | 14 | |
| 15 | | if ( ! current_user_can( 'edit_theme_options' ) ) |
| | 15 | if ( ! current_user_can( 'edit_theme_options' ) ) { |
| 16 | 16 | wp_die( __( 'Cheatin’ uh?' ) ); |
| | 17 | } |
| 17 | 18 | |
| 18 | 19 | wp_reset_vars( array( 'url', 'return' ) ); |
| 19 | | $url = urldecode( $url ); |
| | 20 | $url = wp_unslash( $url ); |
| 20 | 21 | $url = wp_validate_redirect( $url, home_url( '/' ) ); |
| 21 | | if ( $return ) |
| 22 | | $return = wp_validate_redirect( urldecode( $return ) ); |
| 23 | | if ( ! $return ) |
| | 22 | if ( $return ) { |
| | 23 | $return = wp_unslash( $return ); |
| | 24 | $return = wp_validate_redirect( $return ); |
| | 25 | } |
| | 26 | if ( ! $return ) { |
| 24 | 27 | $return = $url; |
| | 28 | } |
| 25 | 29 | |
| 26 | 30 | global $wp_scripts, $wp_customize; |
| 27 | 31 | |
diff --git src/wp-admin/menu.php src/wp-admin/menu.php
index 4008a09..4910fd4 100644
|
|
|
$appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_t
|
| 146 | 146 | |
| 147 | 147 | $menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' ); |
| 148 | 148 | $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' ); |
| 149 | | $submenu['themes.php'][6] = array( __( 'Customize' ), 'edit_theme_options', 'customize.php', 'hide-if-no-customize' ); |
| 150 | | if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) |
| | 149 | |
| | 150 | $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' ); |
| | 151 | $submenu['themes.php'][6] = array( __( 'Customize' ), 'edit_theme_options', $customize_url, 'hide-if-no-customize' ); |
| | 152 | unset( $customize_url ); |
| | 153 | if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { |
| 151 | 154 | $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php'); |
| | 155 | } |
| 152 | 156 | |
| 153 | 157 | unset( $appearance_cap ); |
| 154 | 158 | |