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

acf_enqueue_block_assets() ACF 5.7.13

Enqueues and localizes block scripts and styles.

Хуков нет.

Возвращает

null. Ничего.

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

acf_enqueue_block_assets();

Список изменений

С версии 5.7.13 Введена.

Код acf_enqueue_block_assets() ACF 5.9.1

<?php
function acf_enqueue_block_assets() {

	// Localize text.
	acf_localize_text(array(
		'Switch to Edit'		=> __('Switch to Edit', 'acf'),
		'Switch to Preview'		=> __('Switch to Preview', 'acf'),
		'Change content alignment'	=> __('Change content alignment', 'acf'),

		/* translators: %s: Block type title */
		'%s settings'			=> __('%s settings', 'acf'),
	));
	
	// Get block types.
	$block_types = acf_get_block_types();
	
	// Localize data.
	acf_localize_data(array(
		'blockTypes'	=> array_values( $block_types ),
		
		// List of attributes to replace for HTML to JSX compatibility.
		// https://github.com/facebook/react/blob/master/packages/react-dom/src/shared/possibleStandardNames.js
		'jsxAttributes'	=> array(
			'cellpadding'	=> 'cellPadding',
			'cellspacing'	=> 'cellSpacing',
			'class'			=> 'className',
			'colspan'		=> 'colSpan',
			'for'			=> 'htmlFor',
			'hreflang'		=> 'hrefLang',
			'readonly'		=> 'readOnly',
			'rowspan'		=> 'rowSpan',
			'srclang'		=> 'srcLang',
			'srcset'		=> 'srcSet',
			'allowedblocks'	=> 'allowedBlocks',
			'templatelock'	=> 'templateLock'
		),
		'postType'	=> get_post_type()
	));
	
	// Enqueue script.
	wp_enqueue_script( 'acf-blocks', acf_get_url("pro/assets/js/acf-pro-blocks.min.js"), array('acf-input', 'wp-blocks'), ACF_VERSION, true );
	
	// Enqueue block assets.
	array_map( 'acf_enqueue_block_type_assets', $block_types );
}