Filter
uncanny-automator
automator_autonami_tag_triggers
Filters the available tag triggers for Autonami automations before they are displayed.
add_filter( 'automator_autonami_tag_triggers', $callback, 10, 1 );
Description
Filters the available Autonami tag trigger codes. Developers can add custom tag triggers for Autonami, like `'USER_TAG_ADDED'` or `'CONTACT_TAG_ADDED'`, to extend automation possibilities within the Autonami integration.
Usage
add_filter( 'automator_autonami_tag_triggers', 'your_function_name', 10, 1 );
Parameters
-
$tag_triggers(mixed) - This filter allows you to modify the array of tag trigger slugs that Automator can recognize and use.
Return Value
The filtered value.
Examples
// Add a custom tag trigger for Autonami integration
add_filter( 'automator_autonami_tag_triggers', 'my_custom_autonami_tag_triggers', 10, 1 );
function my_custom_autonami_tag_triggers( $tag_triggers ) {
// Check if the 'USER_TAG_ADDED' trigger already exists, and if not, add it.
// This ensures we don't duplicate triggers if they are already defined elsewhere.
if ( ! in_array( 'USER_TAG_ADDED', $tag_triggers ) ) {
$tag_triggers[] = 'USER_TAG_ADDED';
}
// Add a new custom tag trigger.
$tag_triggers[] = 'MY_CUSTOM_TAG_TRIGGER';
// Return the modified array of tag triggers.
return $tag_triggers;
}
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
src/integrations/autonami/tokens/autonami-tokens.php:52
public function get_tag_triggers() {
$tag_triggers = array(
'USER_TAG_ADDED',
'CONTACT_TAG_ADDED',
);
return apply_filters( 'automator_autonami_tag_triggers', $tag_triggers );
}
Internal Usage
Found in uncanny-automator-pro/src/integrations/autonami/tokens/autonami-pro-tokens.php:20:
add_filter( 'automator_autonami_tag_triggers', array( $this, 'add_tag_triggers' ), 10, 1 );