Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: enqueue_block_assets

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
332      if ( current_theme_supports( 'wp-block-styles' ) ) {
333           wp_enqueue_style( 'wp-block-library-theme' );
334      }
335
336      /*
337       * We don't want to load EDITOR scripts in the iframe, only enqueue
338       * front-end assets for the content.
339       */
340      add_filter( 'should_load_block_editor_scripts_and_styles', '__return_false' );
341      do_action( 'enqueue_block_assets' );
342      remove_filter( 'should_load_block_editor_scripts_and_styles', '__return_false' );
343
344      $block_registry = WP_Block_Type_Registry::get_instance();
345
346      /*
347       * Additionally, do enqueue `editorStyle` assets for all blocks, which
348       * contains editor-only styling for blocks (editor content).
349       */
350      foreach ( $block_registry->get_all_registered() as $block_type ) {