Filters the Swiper.js carousel configuration array used by loop and gallery carousels (Repeater Carousel, Image Carousel, Post / Term / User Loop Carousel). Use this to enable Swiper features the sidebar doesn’t expose — custom transitions, navigation modules, breakpoints, etc.
Parameters
apply_filters( 'afb/settings/carousel', $carousel_settings, $attr, $field );Code language: PHP (php)
$carousel_settings(array) — The Swiper configuration array.$attr(array) — The block attributes array.$field(array) — The ACF field array.
Modifiers
| Tag | Applies to |
|---|---|
afb/settings/carousel | All ACF fields. |
afb/settings/carousel/type={$type} | All fields of a specific field type. |
afb/settings/carousel/name={$name} | All fields with a specific field name. |
afb/settings/carousel/key={$key} | A single field, matched by field key. |
Example
// Enable Swiper's grab cursor on every Gallery field's carousel.
add_filter( 'afb/settings/carousel/type=gallery', function( $settings ) {
$settings['grabCursor'] = true;
return $settings;
} );Code language: PHP (php)