WC_Brands::rest_api_register_routes()publicWC 9.4.0

Register REST API route for /products/brands.

Method of the class: WC_Brands{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Brands = new WC_Brands();
$WC_Brands->rest_api_register_routes();

Changelog

Since 9.4.0 Introduced.

WC_Brands::rest_api_register_routes() code WC 9.5.1

public function rest_api_register_routes() {
	require_once WC()->plugin_path() . '/includes/rest-api/Controllers/Version2/class-wc-rest-product-brands-v2-controller.php';
	require_once WC()->plugin_path() . '/includes/rest-api/Controllers/Version3/class-wc-rest-product-brands-controller.php';

	$controllers = array(
		'WC_REST_Product_Brands_V2_Controller',
		'WC_REST_Product_Brands_Controller'
	);

	foreach ( $controllers as $controller ) {
		( new $controller() )->register_routes();
	}
}