Automator_Get_Data::action_title_from_action_code( $action_code = null )

Accepts a action code(most like from action meta) and returns that associated action title


Parameters Parameters

$action_code

(Optional) null

Default value: null


Top ↑

Return Return

(string)


Source Source

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

	public function action_title_from_action_code( $action_code = null ) {

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

			return null;
		}

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

		foreach ( $system_actions as $system_action ) {

			if ( $system_action['code'] === $action_code ) {
				return str_replace( array( '{', '}' ), '', $system_action['select_option_name'] );
			}
		}

		return null;
	}