All docs / Developer Guide

Extending Automation Recipes

Overview of creating custom triggers, conditions, actions, and merge fields for InfusedWoo.

InfusedWoo Automation Recipes can be extended by third-party plugins and mu-plugins. You can create custom triggers, conditions, actions, and merge fields without modifying InfusedWoo itself.

How It Works

InfusedWoo provides three global registration functions and a dedicated WordPress action hook:

  • iw_add_trigger_class($class_name) - Register a custom trigger
  • iw_add_condition_class($class_name) - Register a custom condition
  • iw_add_action_class($class_name) - Register a custom action
  • infusedwoo_automation_loaded - Action hook that fires after all built-in recipes are loaded

Getting Started

Create a WordPress plugin or mu-plugin and hook into infusedwoo_automation_loaded:

<?php
/**
 * Plugin Name: My InfusedWoo Extension
 * Description: Custom automation triggers, conditions, and actions
 * Requires Plugins: infusedwoo
 */

add_action('infusedwoo_automation_loaded', function() {
    require_once __DIR__ . '/triggers/my-trigger.php';
    require_once __DIR__ . '/conditions/my-condition.php';
    require_once __DIR__ . '/actions/my-action.php';
});

Important: Always use the infusedwoo_automation_loaded hook. This ensures InfusedWoo’s base classes are available and all built-in items are loaded before your code runs.

Checking if InfusedWoo is Active

The infusedwoo_automation_loaded hook only fires if InfusedWoo is active, so code inside it is safe. For code outside:

if (function_exists('iw_add_trigger_class')) {
    // InfusedWoo is active
}

Guides

Plugin Structure Example

my-infusedwoo-extension/
  my-infusedwoo-extension.php    # Main plugin file
  triggers/
    my-form-submit-trigger.php   # Custom trigger
  conditions/
    my-membership-condition.php  # Custom condition
  actions/
    my-slack-action.php          # Custom action