Make WordPress Core


Ignore:
Timestamp:
07/08/2014 05:14:20 PM (11 years ago)
Author:
helen
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/menu.php

    r27418 r29026  
    147147$menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
    148148    $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' ) ) {
    151154        $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');
     155    }
    152156
    153157unset( $appearance_cap );
Note: See TracChangeset for help on using the changeset viewer.