Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Populate_From_Query::add_trigger_value( $trigger_id )

Populates the POST array with the data and adds trigger value.


Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Parameters Parameters

$trigger_id

(Required)


Top ↑

Return Return

(bool)


Source Source

File: src/core/classes/class-populate-from-query.php

	public static function add_trigger_value( $trigger_id ) {
		$_POST['itemId']      = $trigger_id;
		$_POST['optionCode']  = $_GET['optionCode'];
		$_POST['optionValue'] = array(
			$_POST['optionCode']               => $_GET['optionValue'],
			$_POST['optionCode'] . '_readable' => urldecode( $_GET['optionValue_readable'] ),
		);
		$trigger_value_added = self::$recipe->update( '' );
		if ( ! $trigger_value_added->data['success'] ) {
			throw new \Exception( "Trigger value couldn't be set." );
		}
		return true;
	}