uo_automator_acf_disallowed_post_types
Filters the post types that are disallowed from being used with the ACF integration of the Automator.
add_filter( 'uo_automator_acf_disallowed_post_types', $callback, 10, 1 );
Description
Filters the list of post types disallowed for ACF automations. Developers can add or remove post types from this array to control which content types are available for ACF trigger and action fields. This prevents conflicts with core WordPress functionalities.
Usage
add_filter( 'uo_automator_acf_disallowed_post_types', 'your_function_name', 10, 1 );
Parameters
-
$disallowed_post_types(mixed) - This parameter contains an array of post types that are disallowed from being used with the ACF integration in Uncanny Automator.
Return Value
The filtered value.
Examples
// Prevent Uncanny Automator from using the 'revision' post type for ACF triggers.
// This is a good practice to avoid unexpected behavior or unnecessary processing.
add_filter(
'uo_automator_acf_disallowed_post_types',
function( $disallowed_post_types ) {
// Ensure $disallowed_post_types is an array before adding to it.
if ( ! is_array( $disallowed_post_types ) ) {
$disallowed_post_types = array();
}
// Add the 'revision' post type to the list of disallowed types.
$disallowed_post_types[] = 'revision';
return $disallowed_post_types;
},
10, // Priority
1 // Accepted arguments
);
Placement
This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.
Source Code
uncanny-automator-pro/src/integrations/acf/helpers/acf-helpers-pro.php:83
uncanny-automator-pro/src/integrations/acf/triggers/acf-post-field-updated.php:191
uncanny-automator-pro/src/integrations/acf/triggers/acf-user-post-field-updated.php:537
public static function get_disallowed_post_types() {
$disallowed_post_types = array(
'attachment',
'revision',
'nav_menu_item',
'custom_css',
'customize_changeset',
'oembed_cache',
'user_request',
'wp_block',
'wp_template',
);
return apply_filters( 'uo_automator_acf_disallowed_post_types', $disallowed_post_types );
}