woocommerce_email_editor_preload_rest_api_routes
Filters the REST API routes preloaded for the email editor.
Использование
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(строка)
- The edited post type.
- $post_id(int|строка)
- The edited post ID.
Список изменений
| С версии 11.2.0 | Введена. |
Где вызывается хук
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 );