Warning: This method has been deprecated.

Automator_Get_Data::trigger_meta_from_trigger_code( $trigger_code = null )

Accepts a trigger code(most like from trigger meta) and returns that associated trigger add_action hook


Parameters Parameters

$trigger_code

(Optional) null

Default value: null


Top ↑

Return Return

(bool)


Source Source

File: src/core/lib/utilities/class-automator-get-data.php

	public function trigger_meta_from_trigger_code( $trigger_code = null ) {

		if ( null === $trigger_code || ! is_string( $trigger_code ) ) {
			Automator()->error->add_error( 'trigger_meta_from_trigger_code', 'ERROR: You are trying to get a trigger meta from a trigger code without providing a $trigger_code', $this );

			return null;
		}

		// Load all default trigger settings
		$system_triggers = Automator()->get_triggers();
		if ( empty( $system_triggers ) ) {
			return null;
		}

		foreach ( $system_triggers as $system_trigger ) {

			if ( $system_trigger['code'] === $trigger_code ) {
				return isset( $system_trigger['meta'] ) ? $system_trigger['meta'] : null;
			}
		}

		return null;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0 Introduced.