Documentation

ACF Custom Database Tables v1.1

Removing support for fields

You can remove fields from the supported field list, if you need to. When doing so, you have the ACF field array to evaluate, so you have a good degree of flexibility:


 * Removing fields from the 'supported fields' list. This affects table definition
 * generation and can go in your functions.php file or a plugin.
 */
add_filter( 'acfcdt/is_supported_field', function ( $is_supported, $field ) {

    // removing support for a built in field type
    if ( $field['type'] === 'text' ) {
        return false;
    }

    // removing support for a specific field by name
    if ( $field['name'] === 'my_custom_field' ) {
        return false;
    }

    return $is_supported;
}, 10, 2 );

Spot an issue? Please let us know about it.

Good dev stuff, delivered.

Product news, tips, and other cool things we make.

We never share your data. Read our Privacy Policy

© 2016 – 2024 Hookturn Digital. All rights reserved.