Automator_Get_Data::trigger_sentence( $id,  $type = '' )


Parameters Parameters

$id

(Required)

$type

(Optional)

Default value: ''


Top ↑

Return Return

(array|mixed|string)


Source Source

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

	public function trigger_sentence( $id, $type = '' ) {

		global $wpdb;
		$trigger_meta = $wpdb->get_results(
			$wpdb->prepare(
				"SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = %d",
				$id
			)
		);

		$sentence = $this->get_trigger_action_sentence( $id );
		$sentence = apply_filters_deprecated(
			'get_trigger_sentence',
			array( $sentence, $type, $trigger_meta ),
			'3.0',
			'automator_get_trigger_sentence'
		);
		$sentence = apply_filters( 'automator_get_trigger_sentence', $sentence, $id, $type );

		if ( in_array( $type, array_keys( $sentence ), true ) ) {
			return $sentence[ $type ];
		}

		return $sentence;
	}