WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

wp_enqueue_registered_block_scripts_and_styles() WP 5.0.0

Enqueues registered block scripts and styles, depending on current rendered context (only enqueuing editor scripts while in context of the editor).

  • Global. WP_Screen. $current_screen

Хуков нет.

Возвращает

Ничего (null).

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

wp_enqueue_registered_block_scripts_and_styles();

Код wp enqueue registered block scripts and styles: wp-includes/script-loader.php VER 5.1.1

<?php
function wp_enqueue_registered_block_scripts_and_styles() {
	global $current_screen;

	$is_editor = ( ( $current_screen instanceof WP_Screen ) && $current_screen->is_block_editor() );

	$block_registry = WP_Block_Type_Registry::get_instance();
	foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
		// Front-end styles.
		if ( ! empty( $block_type->style ) ) {
			wp_enqueue_style( $block_type->style );
		}

		// Front-end script.
		if ( ! empty( $block_type->script ) ) {
			wp_enqueue_script( $block_type->script );
		}

		// Editor styles.
		if ( $is_editor && ! empty( $block_type->editor_style ) ) {
			wp_enqueue_style( $block_type->editor_style );
		}

		// Editor script.
		if ( $is_editor && ! empty( $block_type->editor_script ) ) {
			wp_enqueue_script( $block_type->editor_script );
		}
	}
}