Skip to content

Commit

Permalink
Add the version prefix to the endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeymitr committed Sep 23, 2024
1 parent 8bfbadb commit 6357e97
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion projects/plugins/jetpack/class.json-api-endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -2645,9 +2645,10 @@ public function get_amp_cache_origins( $siteurl ) {
* @throws Exception The exception if something goes wrong.
*/
public function create_rest_route_for_endpoint() {
$version_prefix = $this->max_version ? 'v' . $this->max_version : '';
register_rest_route(
static::REST_NAMESPACE,
$this->rest_route,
$version_prefix . $this->rest_route,

Check failure on line 2651 in projects/plugins/jetpack/class.json-api-endpoints.php

View workflow job for this annotation

GitHub Actions / Static analysis

TypeError PhanTypeSuspiciousStringExpression Suspicious type bool of a variable or expression $this->rest_route used to build a string. (Expected type to be able to cast to a string)
array(
'methods' => $this->method,
'callback' => array( $this, 'rest_callback' ),
Expand Down

0 comments on commit 6357e97

Please sign in to comment.