ACF_Form_Gutenberg::enqueue_block_editor_assets
enqueue_block_editor_assets
Allows a safe way to customize Guten-only functionality.
Method of the class: ACF_Form_Gutenberg{}
No Hooks.
Returns
null. Nothing (null).
Usage
$ACF_Form_Gutenberg = new ACF_Form_Gutenberg(); $ACF_Form_Gutenberg->enqueue_block_editor_assets();
Changelog
| Since 5.8.0 | Introduced. |
ACF_Form_Gutenberg::enqueue_block_editor_assets() ACF Form Gutenberg::enqueue block editor assets code ACF 6.0.4
function enqueue_block_editor_assets() {
// Remove edit_form_after_title.
add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 20, 0 );
// Call edit_form_after_title manually.
add_action( 'block_editor_meta_box_hidden_fields', array( $this, 'block_editor_meta_box_hidden_fields' ) );
// Customize editor metaboxes.
add_filter( 'filter_block_editor_meta_boxes', array( $this, 'filter_block_editor_meta_boxes' ) );
// Trigger ACF enqueue scripts as the site editor doesn't trigger this from form-post.php
acf_enqueue_scripts(
array(
'uploader' => true,
)
);
}