Inventory_Presser_Shortcode_Hours_Today::driver( array $atts )

driver


Description Description

The shortcode callback method that returns the sentence.


Top ↑

Parameters Parameters

$atts

(array) (Required)


Top ↑

Return Return

(string) The sentence


Top ↑

Source Source

File: includes/shortcode/class-shortcode-hours-today.php

	public function driver( $atts ) {
		// setup default attributes
		$atts = shortcode_atts(
			array(
				'hours_uid' => 0,
			),
			$atts
		);

		/**
		 * Find hours for which we will create sentence(s)
		 */
		$hours_set = $this->find_hours_set( $atts );
		if ( null == $hours_set ) {
			return '';
		}

		$days = $this->create_days_array_from_hours_array( $hours_set );
		return $this->create_sentence( $days );
	}