Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $type parameter to ep_do_intercept_request filter #2443

Merged
merged 2 commits into from
Nov 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion includes/classes/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1151,13 +1151,16 @@ public function remote_request( $path, $args = [], $query_args = [], $type = nul
* Filter intercepted request
*
* @hook ep_do_intercept_request
* @since 3.2.2
* @since 4.0.0 added $type
* @param {array} $request New remote request response
* @param {array} $query Remote request arguments
* @param {args} $args Request arguments
* @param {int} $failures Number of failures
* @param {string} $type Type of request
* @return {array} New request
*/
$request = apply_filters( 'ep_do_intercept_request', new WP_Error( 400, 'No Request defined' ), $query, $args, $failures );
$request = apply_filters( 'ep_do_intercept_request', new WP_Error( 400, 'No Request defined' ), $query, $args, $failures, $type );
} else {
$request = wp_remote_request( $query['url'], $args ); // try the existing host to avoid unnecessary calls.
}
Expand Down