Inventory_Presser_Shortcode_Hours_Today::append_hours_today_to_hours_widget( string $hours_title_html, string $hours_uid )

append_hours_today_to_hours_widget

Description Description

Returns the output of the shortcode wrapped in some HTML


Top ↑

Parameters Parameters

$hours_title_html

(string) (Required)

$hours_uid

(string) (Required)


Top ↑

Return Return

(string) HTML that renders a sentence


Top ↑

Source Source

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

	function append_hours_today_to_hours_widget( $hours_title_html, $hours_uid ) {
		$shortcode        = '[' . self::SHORTCODE_TAG . ' hours_uid="' . $hours_uid . '"]';
		$shortcode_output = '';
		if ( function_exists( 'apply_shortcodes' ) ) {
			$shortcode_output = apply_shortcodes( $shortcode );
		} elseif ( function_exists( 'do_shortcode' ) ) {
			$shortcode_output = do_shortcode( $shortcode );
		}

		if ( empty( $shortcode_output ) ) {
			return $hours_title_html;
		}

		return $hours_title_html . '<p class="invp-hours-today">' . $shortcode_output . '</p>';
	}