Update API
This commit is contained in:
parent
bafb8ae380
commit
0f2d07c65c
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* REST API Authentication
|
||||
*
|
||||
* @package WooCommerce/API
|
||||
* @package Opalestate/API
|
||||
* @since 2.6.0
|
||||
*/
|
||||
|
||||
@ -578,7 +578,7 @@ class Opalestate_REST_Authentication {
|
||||
*/
|
||||
public function send_unauthorized_headers( $response ) {
|
||||
if ( is_wp_error( $this->get_error() ) && 'basic_auth' === $this->auth_method ) {
|
||||
$auth_message = __( 'WooCommerce API. Use a consumer key in the username field and a consumer secret in the password field.', 'opalestate-pro' );
|
||||
$auth_message = __( 'Opalestate API. Use a consumer key in the username field and a consumer secret in the password field.', 'opalestate-pro' );
|
||||
$response->header( 'WWW-Authenticate', 'Basic realm="' . $auth_message . '"', true );
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class Opalestate_Agency_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_items' ],
|
||||
// 'permission_callback' => [ $this, 'get_items_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_items_permissions_check' ],
|
||||
'args' => $this->get_collection_params(),
|
||||
],
|
||||
]
|
||||
@ -78,7 +78,7 @@ class Opalestate_Agency_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_item' ],
|
||||
// 'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
],
|
||||
// [
|
||||
// 'methods' => WP_REST_Server::EDITABLE,
|
||||
@ -101,7 +101,7 @@ class Opalestate_Agency_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_listings' ],
|
||||
// 'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -50,7 +50,7 @@ class Opalestate_Agent_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_items' ],
|
||||
// 'permission_callback' => [ $this, 'get_items_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_items_permissions_check' ],
|
||||
'args' => $this->get_collection_params(),
|
||||
],
|
||||
]
|
||||
@ -69,7 +69,7 @@ class Opalestate_Agent_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_item' ],
|
||||
// 'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
],
|
||||
// [
|
||||
// 'methods' => WP_REST_Server::EDITABLE,
|
||||
@ -92,7 +92,7 @@ class Opalestate_Agent_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_listings' ],
|
||||
// 'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
@ -73,7 +73,7 @@ class Opalestate_Property_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_item' ],
|
||||
// 'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_item_permissions_check' ],
|
||||
],
|
||||
// [
|
||||
// 'methods' => WP_REST_Server::EDITABLE,
|
||||
@ -102,7 +102,7 @@ class Opalestate_Property_Api extends Opalestate_Base_API {
|
||||
[
|
||||
'methods' => WP_REST_Server::READABLE,
|
||||
'callback' => [ $this, 'get_results' ],
|
||||
// 'permission_callback' => [ $this, 'get_items_permissions_check' ],
|
||||
'permission_callback' => [ $this, 'get_items_permissions_check' ],
|
||||
'args' => $this->get_search_params(),
|
||||
],
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user