Ameliabooking_Helpers::validate_trigger( $args = array() )

Validate trigger.

Contents


Return Return

(boolean) False if args is empty. Otherwise, True.


Source Source

File: src/integrations/ameliabooking/helpers/ameliabooking-helpers.php

	public function validate_trigger( $args = array() ) {

		// Bailout if args is empty.
		if ( empty( $args ) ) {
			return false;
		}

		$booking = array_shift( $args[0] );

		if ( empty( $booking['type'] ) ) {
			return false;
		}

		// Only run for appointments. Dont run for events.
		if ( 'appointment' === $booking['type'] ) {
			return true;
		}

		return false;

	}