Inventory_Presser_Shortcode_Hours_Today::driver( array $atts )
driver
On This Page
Description Description
The shortcode callback method that returns the sentence.
Parameters Parameters
- $atts
-
(array) (Required)
Return Return
(string) The sentence
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,
self::SHORTCODE_TAG
);
/**
* 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 );
}
Expand full source codeCollapse full source codeView on Github