Skip to content

Commit

Permalink
Filter REST request.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilyatmobtown committed Dec 8, 2023
1 parent d0e218b commit c429764
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/class-wp-proxy-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@
*/
class WP_Proxy_Service {

public function init(): void {
add_filter( 'rest_request_before_callbacks', [ $this, 'filter_rest_request_before_callbacks' ], 10, 3 );
}

public function filter_rest_request_before_callbacks( $return, $request, $route ) {

Check failure on line 21 in src/class-wp-proxy-service.php

View workflow job for this annotation

GitHub Actions / code-quality / phpstan PHP 8.1

Method Alley\WP\Proxy_Service\WP_Proxy_Service::filter_rest_request_before_callbacks() has no return type specified.

Check failure on line 21 in src/class-wp-proxy-service.php

View workflow job for this annotation

GitHub Actions / code-quality / phpstan PHP 8.1

Method Alley\WP\Proxy_Service\WP_Proxy_Service::filter_rest_request_before_callbacks() has parameter $request with no type specified.

Check failure on line 21 in src/class-wp-proxy-service.php

View workflow job for this annotation

GitHub Actions / code-quality / phpstan PHP 8.1

Method Alley\WP\Proxy_Service\WP_Proxy_Service::filter_rest_request_before_callbacks() has parameter $return with no type specified.

Check failure on line 21 in src/class-wp-proxy-service.php

View workflow job for this annotation

GitHub Actions / code-quality / phpstan PHP 8.1

Method Alley\WP\Proxy_Service\WP_Proxy_Service::filter_rest_request_before_callbacks() has parameter $route with no type specified.
return $response;

Check failure on line 22 in src/class-wp-proxy-service.php

View workflow job for this annotation

GitHub Actions / code-quality / phpstan PHP 8.1

Undefined variable: $response
}
}

0 comments on commit c429764

Please sign in to comment.