Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: block_editor_rest_api_preload_paths

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
403      global $post;
404
405      /**
406       * Filters the array of REST API paths that will be used to preloaded common data for the block editor.
407       *
408       * @since 5.8.0
409       *
410       * @param string[] $preload_paths Array of paths to preload.
411       */
412      $preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context );
413      if ( ! empty( $block_editor_context->post ) ) {
414           $selected_post = $block_editor_context->post;
415
416           /**
417            * Filters the array of paths that will be preloaded.
418            *
419            * Preload common data by specifying an array of REST API paths that will be preloaded.
420            *
421            * @since 5.0.0