Make WordPress Core

Ticket #32637: 32637.3.patch

File 32637.3.patch, 778 bytes (added by McGuive7, 10 years ago)

Update patch to include additional check to HTTP referrer to determine whether to return to admin vs front-end.

  • wp-admin/customize.php

     
    1 <?php
     1        <?php
    22/**
    33 * Theme Customize Screen.
    44 *
     
    2626if ( ! $return ) {
    2727        if ( $url ) {
    2828                $return = $url;
    29         } elseif ( current_user_can( 'edit_theme_options' ) || current_user_can( 'switch_themes' ) ) {
    30                 $return = admin_url( 'themes.php' );
     29        } elseif (
     30                ( current_user_can( 'edit_theme_options' ) || current_user_can( 'switch_themes' ) ) ||
     31                ( isset( $_SERVER['HTTP_REFERER'] ) && false !== strpos( $_SERVER['HTTP_REFERER'], admin_url() ) )
     32        ) {
     33                $return = admin_url();
    3134        } else {
    32                 $return = admin_url();
     35                $return = home_url( '/' );
    3336        }
    3437}
    3538