block_editor_rest_api_preload_paths хук-фильтрWP 5.8.0

Filters the array of REST API paths that will be used to preloaded common data for the block editor.

Использование

add_filter( 'block_editor_rest_api_preload_paths', 'wp_kama_block_editor_rest_api_preload_paths_filter', 10, 2 );

/**
 * Function for `block_editor_rest_api_preload_paths` filter-hook.
 * 
 * @param string|string[])[]      $preload_paths        Array of paths to preload.
 * @param WP_Block_Editor_Context $block_editor_context The current block editor context.
 *
 * @return string|string[])[]
 */
function wp_kama_block_editor_rest_api_preload_paths_filter( $preload_paths, $block_editor_context ){

	// filter...
	return $preload_paths;
}
$preload_paths(строка|string[])[])
Array of paths to preload.
$block_editor_context(WP_Block_Editor_Context)
The current block editor context.

Список изменений

С версии 5.8.0 Введена.

Где вызывается хук

block_editor_rest_api_preload()
block_editor_rest_api_preload_paths
wp-includes/block-editor.php 703
$preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context );

Где используется хук в WordPress

Использование не найдено.