Skip to content

Commit

Permalink
add update-api as REST endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Dec 20, 2024
1 parent e960203 commit 88ddabd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
19 changes: 19 additions & 0 deletions src/Git_Updater/REST/REST_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 88ddabd

Please sign in to comment.