1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89:
<?php
if ( !class_exists( 'Inbound_Automation_Trigger_User_Register' ) ) {
class Inbound_Automation_Trigger_User_Register {
static $trigger;
function __construct() {
self::$trigger = 'user_register';
add_filter( 'inbound_automation_triggers' , array( __CLASS__ , 'define_trigger' ) , 1 , 1);
}
public static function define_trigger( $triggers ) {
$arguments = apply_filters('trigger/user_register/trigger_arguments/' , array(
'user_id' => array(
'id' => 'user_id',
'label' => __( 'User ID' , 'inbound-pro')
)
) );
$db_lookup_filters = apply_filters( 'trigger/uer_register/db_arguments' , array (
array(
'id' => 'user_data',
'label' => __( 'Validate User Data', 'inbound-pro' ),
'class_name' => 'Inbound_Automation_Query_User'
)
));
$actions = apply_filters('trigger/user_register/actions' , array(
'create_lead' ,'add_remove_lead_list','add_remove_lead_tag','send_email' , 'wait' , 'relay_data'
) );
$triggers[ self::$trigger ] = array (
'label' => __('On new WP user creation' , 'inbound-pro'),
'description' => __('This trigger fires whenever new user is created inside the WordPress system.' , 'inbound-pro'),
'action_hook' => self::$trigger ,
'arguments' => $arguments,
'db_lookup_filters' => $db_lookup_filters,
'actions' => $actions
);
return $triggers;
}
public static function create_dummy_event() {
$event = array (
'user_id' => 1
);
$inbound_arguments = Inbound_Options_API::get_option( 'inbound_automation' , 'arguments' );
$inbound_arguments = ( $inbound_arguments ) ? $inbound_arguments : array();
$inbound_arguments[self::$trigger]['user_id'] = $lead;
Inbound_Options_API::update_option( 'inbound_automation' , 'arguments' , $inbound_arguments );
}
}
new Inbound_Automation_Trigger_User_Register;
}