Skip to content

Commit

Permalink
Allow POST also for REST API endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Olaru committed Nov 7, 2019
1 parent d8df4df commit 6b546df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/class-Backstage_REST_Controller_v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function register_routes() {
}

register_rest_route( Backstage_REST_Controller_v1::REST_NAMESPACE, '/' . Backstage_REST_Controller_v1::REST_FRONT_BASE . '/customizer_link', array(
'methods' => WP_REST_Server::READABLE,
'methods' => array( WP_REST_Server::READABLE, WP_REST_Server::CREATABLE ), // We allow both to make sure that users can get around issues with GET and multidimensional arrays as parameters.
'callback' => array( $this, 'get_customizer_link' ),
'permission_callback' => array( $this, 'get_customizer_link_permissions_check' ),
'args' => $args,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6b546df

Please sign in to comment.