acf/blocks/fields_to_open_in_expanded_editor
Description
This filter allows developers to modify the array of field types that, when utilized within an ACF block’s inline toolbar, will trigger the expanded editor interface upon interaction. By default, Repeater and Flexible Content fields open in the expanded editor.
Changelog
- Added in version 6.7.
Parameters
apply_filters( 'acf/blocks/fields_to_open_in_expanded_editor', $field_types );
$field_types(array) An array of field type names.
Return
(array) The filtered array of field type names.
Example
This example demonstrates how to add the Group field type to the list of fields that open in the expanded editor, alongside the default Repeater and Flexible Content types.
<?php
/**
* Adds the 'group' field type to the list of fields that open in the expanded editor.
*
* @param array $field_types An array of field type names.
* @return array
*/
function my_acf_add_group_to_expanded_editor( $field_types ) {
$field_types[] = 'group'; // Add the Group field type.
return $field_types;
}
add_filter( 'acf/blocks/fields_to_open_in_expanded_editor', 'my_acf_add_group_to_expanded_editor' );
这篇文档对你有帮助吗?
谢谢你的反馈!