Widget_Month::filter_month_day( string $html, string $file, array $name, Tribe__Template $template )
Pads “today” in days list with events up to the limit.
Contents
Parameters
- $html
-
(string) (Required) The final HTML.
- $file
-
(string) (Required) Complete path to include the PHP File.
- $name
-
(array) (Required) Template name.
- $template
-
(Tribe__Template) (Required) Current instance of the Tribe__Template.
Return
(string) $html The final HTML.
Source
File: src/Tribe/Views/V2/Widgets/Widget_Month.php
public function filter_month_day( $html, $file, $name, $template ) {
$today = Dates::build_date_object( $template->get( 'url_event_date', $template->get( 'today', 'today' ) ) );
if ( $today->format('Y-m-d') !== $template->get( 'day_date' ) || tribe_context()->doing_ajax() ) {
return $html;
}
$day = $template->get( 'day', [] );
$the_day_events = $day[ 'events' ];
$events_per_day = absint( $this->get_argument( 'count' ) );
$the_day_events = $this->the_day_events( $template, $events_per_day, $the_day_events );
if ( 0 < count($the_day_events) ) {
$day['is-widget-today'] = true;
$template->set( 'day', $day );
}
return $html;
}
Changelog
| Version | Description |
|---|---|
| 5.6.0 | Introduced. |