block_editor_rest_api_preload_paths filter-hookWP 5.8.0

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

Usage

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|string[])[])
Array of paths to preload.
$block_editor_context(WP_Block_Editor_Context)
The current block editor context.

Changelog

Since 5.8.0 Introduced.

Where the hook is called

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 );

Where the hook is used in WordPress

Usage not found.