WC_Legacy_API::handle_v2_rest_api_request()
Устарела с версии 2.6.0. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.
Handle legacy v2 REST API requests.
Метод класса: WC_Legacy_API{}
Хуки из метода
Возвращает
null
. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->handle_v2_rest_api_request();
Список изменений
С версии 2.4 | Введена. |
Устарела с | 2.6.0 |
Код WC_Legacy_API::handle_v2_rest_api_request() WC Legacy API::handle v2 rest api request WC 8.1.1
private function handle_v2_rest_api_request() { include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-exception.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-server.php' ); include_once( dirname( __FILE__ ) . '/api/v2/interface-wc-api-handler.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-json-handler.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-authentication.php' ); $this->authentication = new WC_API_Authentication(); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-resource.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-coupons.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-customers.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-orders.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-products.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-reports.php' ); include_once( dirname( __FILE__ ) . '/api/v2/class-wc-api-webhooks.php' ); // allow plugins to load other response handlers or resource classes. do_action( 'woocommerce_api_loaded' ); $this->server = new WC_API_Server( $GLOBALS['wp']->query_vars['wc-api-route'] ); // Register available resources for legacy v2 REST API request. $api_classes = apply_filters( 'woocommerce_api_classes', array( 'WC_API_Customers', 'WC_API_Orders', 'WC_API_Products', 'WC_API_Coupons', 'WC_API_Reports', 'WC_API_Webhooks', ) ); foreach ( $api_classes as $api_class ) { $this->$api_class = new $api_class( $this->server ); } // Fire off the request. $this->server->serve_request(); }