# chatbot/8.8.1/addons/automator/includes/triggers/trigger.php

WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services, version 8.8.1. 81 lines.

- Page: https://pluginprobe.com/plugins/chatbot/8.8.1/code/addons/automator/includes/triggers/trigger.php
- Raw: https://pluginprobe.com/plugins/chatbot/8.8.1/raw/addons/automator/includes/triggers/trigger.php
- Modified: 2026-09-28T11:58:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/chatbot/8.8.1/code/addons/automator/includes/triggers/trigger.php#L10-L20`.

```php
<?php
/**
 * Abstract Trigger Class
 *
 * @package WPbot_Automator
 */

namespace WPbot_Automator\Triggers;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Abstract Class Trigger
 */
abstract class Trigger {

	/**
	 * Trigger ID
	 * 
	 * @var string
	 */
	protected $id;

	/**
	 * Trigger Title
	 * 
	 * @var string
	 */
	protected $title;

	/**
	 * Trigger Group (e.g., 'WordPress', 'WooCommerce')
	 * 
	 * @var string
	 */
	protected $group;

	/**
	 * Get Trigger ID
	 */
	public function get_id() {
		return $this->id;
	}

	/**
	 * Get Trigger Title
	 */
	public function get_title() {
		return $this->title;
	}

	/**
	 * Get Trigger Group
	 */
	public function get_group() {
		return $this->group;
	}

	/**
	 * Register the trigger (hooks)
	 */
	abstract public function register();

	/**
	 * Process the trigger execution
	 * 
	 * @param array $data Data passed from the hook.
	 */
	protected function run( $data = array() ) {
		// This will call the Workflow Engine to find and run matching workflows.
		$full_trigger_id = $this->id;
		if ( isset( $data['sub_id'] ) ) {
			$full_trigger_id .= ':' . $data['sub_id'];
		}
		
		\WPbot_Automator\Engine\Workflow_Runner::run_workflows_for_trigger( $full_trigger_id, $data['data'] );
	}
}

```
