跳转到主要内容

acf/blocks/fields_needing_wide_popover

Description

This filter allows developers to modify the list of ACF field types that will receive a wider popover when used within an ACF Block with toolbar inline editing. This is particularly useful for fields with more complex user interfaces that require additional horizontal space.

By default, the gallery, relationship, wysiwyg, and google_map fields are configured to use a wide popover.

Changelog

  • Added in version 6.7

Parameters

  • $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 'taxonomy' field type to the list of fields that should receive a wide popover.

<?php
/**
 * Adds the 'taxonomy' field to the list of fields needing a wide popover.
 *
 * @param array $field_types An array of field type names.
 * @return array
 */
function my_acf_add_taxonomy_to_wide_popover( $field_types ) {
    $field_types[] = 'taxonomy'; // Add the 'taxonomy' field type.

    return $field_types;
}
add_filter( 'acf/blocks/fields_needing_wide_popover', 'my_acf_add_taxonomy_to_wide_popover' );