Automattic\WooCommerce\Admin\API
LaunchYourStore::register_routes
Register routes.
Метод класса: LaunchYourStore{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$LaunchYourStore = new LaunchYourStore(); $LaunchYourStore->register_routes();
Код LaunchYourStore::register_routes() LaunchYourStore::register routes WC 10.7.0
public function register_routes() {
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/initialize-coming-soon',
array(
array(
'methods' => 'POST',
'callback' => array( $this, 'initialize_coming_soon' ),
'permission_callback' => array( $this, 'must_be_shop_manager_or_admin' ),
),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/update-survey-status',
array(
array(
'methods' => 'POST',
'callback' => array( $this, 'update_survey_status' ),
'permission_callback' => array( $this, 'must_be_shop_manager_or_admin' ),
'args' => array(
'status' => array(
'type' => 'string',
'enum' => array( 'yes', 'no' ),
),
),
),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/survey-completed',
array(
array(
'methods' => 'GET',
'callback' => array( $this, 'has_survey_completed' ),
'permission_callback' => array( $this, 'must_be_shop_manager_or_admin' ),
),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/woopayments/test-orders/count',
array(
array(
'methods' => 'GET',
'callback' => array( $this, 'get_woopay_test_orders_count' ),
'permission_callback' => array( $this, 'must_be_shop_manager_or_admin' ),
),
)
);
register_rest_route(
$this->namespace,
'/' . $this->rest_base . '/woopayments/test-orders',
array(
array(
'methods' => 'DELETE',
'callback' => array( $this, 'delete_woopay_test_orders' ),
'permission_callback' => array( $this, 'must_be_shop_manager_or_admin' ),
),
)
);
}