Skip to content

Commit

Permalink
Merge pull request #84 from xwp/fix/query-string
Browse files Browse the repository at this point in the history
Use add query var
  • Loading branch information
pierlon committed Apr 27, 2020
2 parents c84a941 + 3bf24c8 commit 1aaf70a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/class-rest-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function get_import( $request ) {
$response = $this->prepare_item_for_response( $results, $request );
$response = $this->rest_ensure_response( $response, $request );
$response->set_status( 301 );
$response->header( 'Location', rest_url( sprintf( '%s/%s/%d?context=edit', 'wp/v2', 'media', $attachment_id ) ) );
$response->header( 'Location', add_query_arg( 'context', 'edit', rest_url( sprintf( '%s/%s/%d', 'wp/v2', 'media', $attachment_id ) ) ) );
} catch ( \Exception $e ) {
$response = $this->format_exception( 'single-photo-download', $e->getCode() );
$this->plugin->log_error( $e );
Expand Down

0 comments on commit 1aaf70a

Please sign in to comment.