Changeset 10196 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-favorites.php
- Timestamp:
- 08/21/2020 05:55:20 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-favorites.php
r9666 r10196 62 62 */ 63 63 public function favorite( $request ) { 64 $location = get_permalink( Plugin_Directory::get_plugin_post( $request['plugin_slug'] ) ); 65 header( "Location: $location" ); 66 67 $result = array( 68 'location' => $location, 69 ); 64 $plugin = Plugin_Directory::get_plugin_post( $request['plugin_slug'] ); 65 $result = [ 66 'location' => wp_get_referer() ?: get_permalink( $plugin ), 67 ]; 68 header( 'Location: ' . $result['location'] ); 70 69 71 70 if ( ! isset( $request['favorite'] ) && ! isset( $request['unfavorite'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.