Automattic\WooCommerce\Internal\RestApi\Routes\V4

AbstractController::get_hook_prefixprotectedWC 10.2.0

Get the hook prefix for actions and filters.

Example: woocommerce_rest_api_v4_orders_

Method of the class: AbstractController{}

No Hooks.

Returns

String. The hook prefix.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_hook_prefix(): string;

Changelog

Since 10.2.0 Introduced.

AbstractController::get_hook_prefix() code WC 10.4.3

protected function get_hook_prefix(): string {
	return 'woocommerce_rest_api_v4_' . str_replace( '-', '_', $this->rest_base ) . '_';
}