woocommerce_rest_should_lazy_load_namespace filter-hookWC 10.3.0

Filter whether to lazy load the namespace. When set to false, the namespace will be loaded immediately during initialization.

Usage

add_filter( 'woocommerce_rest_should_lazy_load_namespace', 'wp_kama_woocommerce_rest_should_lazy_load_namespace_filter', 10, 2 );

/**
 * Function for `woocommerce_rest_should_lazy_load_namespace` filter-hook.
 * 
 * @param bool   $should_lazy_load_namespace Whether to lazy load the namespace instead of loading immediately.
 * @param string $route_namespace            The namespace.
 *
 * @return bool
 */
function wp_kama_woocommerce_rest_should_lazy_load_namespace_filter( $should_lazy_load_namespace, $route_namespace ){

	// filter...
	return $should_lazy_load_namespace;
}
$should_lazy_load_namespace(true|false)
Whether to lazy load the namespace instead of loading immediately.
$route_namespace(string)
The namespace.

Changelog

Since 10.3.0 Introduced.

Where the hook is called

RestApiUtil::lazy_load_namespace()
woocommerce_rest_should_lazy_load_namespace
woocommerce/src/Utilities/RestApiUtil.php 56
$should_lazy_load_namespace = apply_filters( 'woocommerce_rest_should_lazy_load_namespace', true, $route_namespace );

Where the hook is used in WooCommerce

Usage not found.