afb/settings/masonry

Filters the Macy.js masonry configuration array used by the Gallery Masonry layout. Use this to tune the masonry behavior beyond the column counts the sidebar exposes — margins, breakpoints, container settings, and any other Macy option.

Parameters

apply_filters( 'afb/settings/masonry', $masonry_settings, $attr, $field );Code language: PHP (php)
  • $masonry_settings (array) — The Macy.js configuration array.
  • $attr (array) — The block attributes array.
  • $field (array) — The ACF field array.

Modifiers

TagApplies to
afb/settings/masonryAll ACF fields.
afb/settings/masonry/type={$type}All fields of a specific field type.
afb/settings/masonry/name={$name}All fields with a specific field name.
afb/settings/masonry/key={$key}A single field, matched by field key.

Example

// Increase the gap between masonry tiles on every Gallery field.
add_filter( 'afb/settings/masonry/type=gallery', function( $settings ) {
    $settings['margin'] = 20;
    return $settings;
} );Code language: PHP (php)