Preventing deletion of custom table data

By default, the plugin will intercept calls made to delete posts and remove all custom table data when the post is removed from the database. Note: Moving a post to the trash does not trigger data removal from custom database tables. This only occurs when the post is removed permanently from the database via the […]

Phil Kurth Phil Kurth

Overriding default field value encode and decode behaviours

When storing a value in a database table, the value cannot be an array or object as these will result in database errors. To protect against this, WordPress’ core meta system attempts to serialize all values before storing them in the core tables. This allows us to pass non-scalar values (arrays, objects) to functions such […]

Want it delivered fresh? You know what to do…

We never share your data.
Read our Privacy Policy

Disabling storage/retrieval to/from custom database tables

A collection of action hooks can be fired to disable/enable data intercept handlers when necessary. Once disabled, data will not be intercepted until re-enabled. You may fire these actions once for a global effect should you need to. How to disable data retrieval from custom database tables <?php // Disables the get field intercept do_action(‘acfcdt/disable_get_field_intercept’); […]

Running custom actions after a table is updated/created

As of version 1.1, it is possible to run custom handlers during the table update process. The ability to run processes right after schema update opens up a number of possibilities including: Custom index creation. Custom logging/notification. Custom data migration handlers. Table field format modifications that might not be possible due to limitations in WordPress’ […]

Globally activate sub tables

It is possible to set a global setting that will enable sub tables on all eligible fields. At the time of writing, the only fields eligible for sub tables are repeaters. We don’t recommend this as you will have a very large number of database tables but, if you need to, you can use the […]

Working with repeater fields

By default, the plugin ignores repeater fields allowing their data to pass through to ACF for storage in core metatables. This is to maintain consistency after updating to version 1.1. You may enable repeater support using either the plugin’s settings panel, or a WordPress filter and then further configure the plugin — using WordPress filters […]

Controlling column data types

As of version 1.1, it is possible to control the data types of custom database table columns. Controlling the type can be useful in reducing your database size and increasing the efficiency of your queries. It’s important to note, due to the way databases work, changing the data types on an existing database may result […]

Activating support for a custom field type

If you are using custom ACF field types and wish to store their values in a custom database table, you need to register the field type as supported. You can do so using the following: <?php /* * This will register a custom field type as supported by the plugin. * This affects table definition […]

Activating join tables on eligible fields

Join tables are available where required for eligible fields and can be activated using filters. The following fields are eligible for join tables: Relationship Post Object Page Link User Taxonomy Global activation It is possible to set a global setting that will enable join tables on all eligible fields. We don’t recommend this, as you […]

Disabling fields for a particular table

If you need to prevent fields from generating columns on a particular table, you can use the following filter: <?php /* * Filtering the array of supported fields for a given table. This affects table * definition generation and can go in your functions.php file or a plugin. */ add_filter( ‘acfcdt/field_group_supported_fields’, function ( $supported_fields, $table_name […]

1 2 3

Good dev stuff, delivered.

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

We never share your data. Read our Privacy Policy

© 2021 Hookturn Digital. All rights reserved.