Making WordPress.org


Ignore:
Timestamp:
08/21/2020 05:55:20 AM (6 years ago)
Author:
dd32
Message:

Plugin Directory: Consistently redirect to the referer instead of just back to the plugin page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-self-close.php

    r9702 r10196  
    5757     */
    5858    public function self_close( $request ) {
    59         $plugin   = Plugin_Directory::get_plugin_post( $request['plugin_slug'] );
    60         $location = get_permalink( $plugin );
    61         header( "Location: $location" );
    62 
     59        $plugin = Plugin_Directory::get_plugin_post( $request['plugin_slug'] );
    6360        $result = [
    64             'location' => $location,
     61            'location' => wp_get_referer() ?: get_permalink( $plugin ),
    6562        ];
     63        header( 'Location: ' . $result['location'] );
    6664
    6765        // Close the plugin.
Note: See TracChangeset for help on using the changeset viewer.