Filter
uncanny-automator
automator_autonami_list_triggers
Filters the list of available Autonami triggers before they are displayed to the user.
add_filter( 'automator_autonami_list_triggers', $callback, 10, 1 );
Description
Fires after Autonami list triggers are defined, allowing developers to add, remove, or modify available triggers. Use this filter to integrate custom Autonami list-related triggers into Uncanny Automator recipes.
Usage
add_filter( 'automator_autonami_list_triggers', 'your_function_name', 10, 1 );
Parameters
-
$list_triggers(mixed) - This parameter contains an array of trigger slugs that are available for use with the Autonami integration.
Return Value
The filtered value.
Examples
// Add a custom trigger to the Autonami list triggers
add_filter( 'automator_autonami_list_triggers', 'my_custom_autonami_list_triggers', 10, 1 );
/**
* Adds a custom trigger to the Autonami list triggers.
*
* @param array $list_triggers The existing list of Autonami triggers.
* @return array The modified list of Autonami triggers.
*/
function my_custom_autonami_list_triggers( $list_triggers ) {
// Check if the trigger already exists to avoid duplicates
if ( ! in_array( 'MY_CUSTOM_LIST_TRIGGER', $list_triggers ) ) {
$list_triggers[] = 'MY_CUSTOM_LIST_TRIGGER';
}
return $list_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:37
public function get_list_triggers() {
$list_triggers = array(
'CONTACT_ADDED_TO_LIST',
'USER_ADDED_TO_LIST',
);
return apply_filters( 'automator_autonami_list_triggers', $list_triggers );
}
Internal Usage
Found in uncanny-automator-pro/src/integrations/autonami/tokens/autonami-pro-tokens.php:19:
add_filter( 'automator_autonami_list_triggers', array( $this, 'add_list_triggers' ), 10, 1 );