woocommerce_email_editor_preload_rest_api_routes │ filter-hook │ WC 11.2.0

Filters the REST API routes preloaded for the email editor.

Usage

add_filter( 'woocommerce_email_editor_preload_rest_api_routes', 'wp_kama_woocommerce_email_editor_preload_rest_api_routes_filter', 10, 3 );

/**
 * Function for `woocommerce_email_editor_preload_rest_api_routes` filter-hook.
 * 
 * @param string[]   $routes    The routes to preload.
 * @param string     $post_type The edited post type.
 * @param int|string $post_id   The edited post ID.
 *
 * @return string[]
 */
function wp_kama_woocommerce_email_editor_preload_rest_api_routes_filter( $routes, $post_type, $post_id ){
	// filter...
	return $routes;
}
$routes(string[])
The routes to preload.
$post_type(string)
The edited post type.
$post_id(int|string)
The edited post ID.

Changelog

Since 11.2.0 Introduced.

Where the hook is called

Assets_Manager::preload_rest_api_data()
woocommerce_email_editor_preload_rest_api_routes
woocommerce/packages/email-editor/src/Engine/class-assets-manager.php 270
$routes = apply_filters( 'woocommerce_email_editor_preload_rest_api_routes', $routes, $post_type, $post_id );

Where the hook is used in WooCommerce

Usage not found.