acf/compatibility

Last updated Feb 17, 2022

Description

Used to enable backwards compatibility support for changed functionality.

Support for each compatibility can be enabled by its own filter. Compatibilities are disabled by default and can be opted-in using the __return_true() function.

Changelog

  • Added in version 5.2.0

Parameters

apply_filters( "acf/compatibility/{$name}", $enabled );
  • $enabled (bool) Whether of not backwards compatibility support is enabled. Defaults to false.

Compatibilities

The following table lists the available compatibilities which can be enabled.

Name Added Description
field_wrapper_class 5.2.0 Field class names changed in v5.2.0 from field_type-{$type} to acf-field-{$type}. This change was introduced to better optimise JS performance.

Example

This example demonstrates how to enable backwards-compatibility for field class names.

functions.php

add_filter('acf/compatibility/field_wrapper_class', '__return_true');
Supercharge Your Website With Premium Features Using ACF PRO

Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More.

Explore Features View Pricing

PRO Features
ACF Blocks
Options Pages
PRO Fields
Repeater
Flexible Content
Gallery
Clone