block_core_image_ensure_interactivity_dependency

函数
block_core_image_ensure_interactivity_dependency ( No parameters )

确保视图脚本具有 `wp-interactivity` 依赖关系。

function block_core_image_ensure_interactivity_dependency() {
	global $wp_scripts;
	if (
		isset( $wp_scripts->registered['wp-block-image-view'] ) &&
		! in_array( 'wp-interactivity', $wp_scripts->registered['wp-block-image-view']->deps, true )
	) {
		$wp_scripts->registered['wp-block-image-view']->deps[] = 'wp-interactivity';
	}
}

常见问题

FAQs
查看更多 >