WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

ProductCategories() WC 1.0

ProductCategories class.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$ProductCategories = new ProductCategories();
// use class methods

Методы

  1. ERROR: no method name found on line ``
  2. ERROR: no method name found on line ``
  3. get_args()
  4. ERROR: no method name found on line ` /**`
  5. ERROR: no method name found on line ``
  6. ERROR: no method name found on line ``
  7. get_path()
  8. get_route_response( \WP_REST_Request $request )
  9. ERROR: no method name found on line ``
  10. ERROR: no method name found on line ``
  11. ERROR: no method name found on line ``
  12. ERROR: no method name found on line ``
  13. ERROR: no method name found on line ``
  14. ERROR: no method name found on line ``

Код ProductCategories: woocommerce/packages/woocommerce-blocks/src/StoreApi/Routes/ProductCategories.php WC 4.3.1

<?php
class ProductCategories extends AbstractTermsRoute {
	/**
	 * Get the path of this REST route.
	 *
	 * @return string
	 */
	public function get_path() {
		return '/products/categories';
	}

	/**
	 * Get method arguments for this REST route.
	 *
	 * @return array An array of endpoints.
	 */
	public function get_args() {
		return [
			[
				'methods'  => \WP_REST_Server::READABLE,
				'callback' => [ $this, 'get_response' ],
				'args'     => $this->get_collection_params(),
			],
			'schema' => [ $this->schema, 'get_public_item_schema' ],
		];
	}

	/**
	 * Get a collection of terms.
	 *
	 * @throws RouteException On error.
	 * @param \WP_REST_Request $request Request object.
	 * @return \WP_REST_Response
	 */
	protected function get_route_response( \WP_REST_Request $request ) {
		return $this->get_terms_response( 'product_cat', $request );
	}
}