automator_integration_loop_filters
Retrieves all filters. The base plugin generally just adds a filter hook that pro or any 3rd-party devs can use to inject their filters. Filters available automator integrations by allowing developers to add or modify them.
add_filter( 'automator_integration_loop_filters', $callback, 10, 1 );
Description
Fires when retrieving all integration filters. Developers can use this filter to add, remove, or modify integration filters, allowing for custom integration display or functionality within the loop. The hook returns an array of filters, which is then processed.
Usage
add_filter( 'automator_integration_loop_filters', 'your_function_name', 10, 1 );
Return Value
The filtered value.
Examples
// Add a custom integration filter to the automator loop filters.
// This example adds a filter for a hypothetical "Custom CRM" integration.
add_filter( 'automator_integration_loop_filters', 'my_custom_automator_crm_filter', 10, 1 );
/**
* Adds a custom CRM integration to the automator loop filters.
*
* @param array $filters The existing array of filters.
* @return array The modified array of filters including the custom CRM.
*/
function my_custom_automator_crm_filter( $filters ) {
// Define the properties for our new custom CRM integration.
$filters['custom_crm'] = array(
'name' => __( 'Custom CRM', 'your-text-domain' ),
'excerpt' => __( 'Connect and automate with your Custom CRM.', 'your-text-domain' ),
'integration_logo' => esc_url( 'https://example.com/path/to/custom-crm-logo.png' ),
'is_pro_only' => 'no', // Make this available in the free version.
'actions' => array(
'add_contact' => __( 'Add Contact', 'your-text-domain' ),
'update_contact' => __( 'Update Contact', 'your-text-domain' ),
),
'triggers' => array(
'new_lead' => __( 'New Lead Received', 'your-text-domain' ),
'contact_updated' => __( 'Contact Updated', 'your-text-domain' ),
),
);
return $filters;
}
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/core/services/integrations/structure.php:445
src/api/components/loop/filter/registry/class-wp-registry.php:241
/**
* Retrieves all filters.
*
* The base plugin generally just adds a filter hook that pro or any 3rd-party devs can use to inject their filters.
*
* @see Loops_Hooks_Register_Singleton::__construct
*/
$filters = apply_filters( 'automator_integration_loop_filters', array() );
// List Free only items
foreach ( (array) $this->all_integrations as $code => $props ) {
$is_pro_only = isset( $props['is_pro_only'] ) && 'yes' === $props['is_pro_only'];
// If it's Pro only, continue
Internal Usage
Found in uncanny-automator-pro/src/core/loops/loop-entry-point.php:64:
add_filter( 'automator_integration_loop_filters', array( $this, 'integration_insert_loop_filters' ), 10, 1 );