Automattic\WooCommerce\Blocks\StoreApi\Routes
ProductAttributeTerms::get_route_response() protected WC 1.0
Get a collection of attribute terms.
{} Это метод класса: ProductAttributeTerms{}
Хуков нет.
Возвращает
\WP_REST_Response
. Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_route_response( \WP_REST_Request $request );
- \WP_REST_Request $request (обязательный)
- -
Код ProductAttributeTerms::get_route_response() ProductAttributeTerms::get route response WC 5.2.1
protected function get_route_response( \WP_REST_Request $request ) {
$attribute = wc_get_attribute( $request['attribute_id'] );
if ( ! $attribute || ! taxonomy_exists( $attribute->slug ) ) {
throw new RouteException( 'woocommerce_rest_taxonomy_invalid', __( 'Attribute does not exist.', 'woocommerce' ), 404 );
}
return $this->get_terms_response( $attribute->slug, $request );
}