Skip to content

Commit

Permalink
Merge pull request #121 from alleyinteractive/filter-request-url
Browse files Browse the repository at this point in the history
Add filter for request URL
  • Loading branch information
mogmarsh authored Aug 20, 2024
2 parents 66673e5 + 5cb5946 commit 1735496
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/class-sp-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,13 @@ public function request( $url = '', $method = 'GET', $body = '', $request_params
'body' => $body,
)
);
/**
* Filters the API URL directly before the request is made.
*
* @param string $url The URL of the request.
* @param array $request_params The request params.
*/
$url = apply_filters( 'sp_api_request_url', $url, $request_params );

$result = sp_remote_request( $url, $request_params );

Expand Down

0 comments on commit 1735496

Please sign in to comment.