Automator_Get_Data::get_trigger_log_meta( null $meta_key = null, null $trigger_id = null, null $trigger_log_id = null, null $run_number = null, null $user_id = null )


Parameters Parameters

$meta_key

(null) (Optional)

Default value: null

$trigger_id

(null) (Optional)

Default value: null

$trigger_log_id

(null) (Optional)

Default value: null

$run_number

(null) (Optional)

Default value: null

$user_id

(null) (Optional)

Default value: null


Top ↑

Return Return

(null|string)


Source Source

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

	public function get_trigger_log_meta( $meta_key = null, $trigger_id = null, $trigger_log_id = null, $run_number = null, $user_id = null ) {

		if ( is_null( $run_number ) || is_null( $trigger_id ) || is_null( $trigger_log_id ) || is_null( $meta_key ) || is_null( $user_id ) ) {
			return null;
		}

		global $wpdb;
		$meta_value = $wpdb->get_var(
			$wpdb->prepare(
				"SELECT meta_value FROM {$wpdb->prefix}uap_trigger_log_meta
									WHERE user_id = %d
									AND automator_trigger_log_id = %d
									AND automator_trigger_id = %d
									AND meta_key = %s
									AND run_number = %d
									LIMIT 0,1",
				$user_id,
				$trigger_log_id,
				$trigger_id,
				$meta_key,
				$run_number
			)
		);
		if ( ! empty( $meta_value ) ) {
			return $meta_value;
		}

		return null;

	}