wp_enqueue_registered_block_scripts_and_styles

Advertisement

Summery Summery

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

Syntax Syntax

wp_enqueue_registered_block_scripts_and_styles()

Source Source

File: wp-includes/script-loader.php

	wp_enqueue_style( 'wp-block-directory' );
}

/**
 * Enqueues the assets required for the format library within the block editor.
 *
 * @since 5.8.0
 */
function wp_enqueue_editor_format_library_assets() {
	wp_enqueue_script( 'wp-format-library' );
	wp_enqueue_style( 'wp-format-library' );
}

/**
 * Sanitizes an attributes array into an attributes string to be placed inside a `<script>` tag.
 *
 * Automatically injects type attribute if needed.
 * Used by {@see wp_get_script_tag()} and {@see wp_get_inline_script_tag()}.
 *
 * @since 5.7.0
 *
 * @param array $attributes Key-value pairs representing `<script>` tag attributes.
 * @return string String made of sanitized `<script>` tag attributes.
 */
function wp_sanitize_script_attributes( $attributes ) {
	$html5_script_support = ! is_admin() && ! current_theme_supports( 'html5', 'script' );
	$attributes_string    = '';

Advertisement

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Advertisement

Leave a Reply