diff --git a/CHANGES.md b/CHANGES.md index 1ac869dc5..6149ffb05 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,6 @@ #### [unreleased] * update GitHub release asset parsing -* update REST_API for Bitbucket update link +* update `REST_API` for Bitbucket update link #### 12.7.2 / 2024-12-18 * update `freemius/wordpress-sdk` diff --git a/src/Git_Updater/REST/REST_API.php b/src/Git_Updater/REST/REST_API.php index 0f1f19c7a..5724f4216 100644 --- a/src/Git_Updater/REST/REST_API.php +++ b/src/Git_Updater/REST/REST_API.php @@ -136,6 +136,25 @@ public function register_endpoints() { ] ); + register_rest_route( + self::$namespace, + 'update-api', + [ + 'show_in_index' => true, + 'methods' => \WP_REST_Server::READABLE, + 'callback' => [ $this, 'get_api_data' ], + 'permission_callback' => '__return_true', + 'args' => [ + 'slug' => [ + 'default' => false, + 'required' => true, + 'validate_callback' => 'sanitize_title_with_dashes', + ], + ], + ] + ); + + $update_args = [ 'key' => [ 'default' => false,