Widget_Month::filter_top_bar( string $html, string $file, array $name, Tribe__Template $template )
Replaces the top-bar (nav) with our own for the widget.
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.
Source
File: src/Tribe/Views/V2/Widgets/Widget_Month.php
public function filter_top_bar( $html, $file, $name, $template ) {
$now = Dates::build_date_object( $template->get( 'now', 'now' ) );
$today = $template->get( 'today', 'today' );
$request_date = Dates::build_date_object( $template->get( 'url_event_date', $today ) );
$new_vars = [
'now' => $now->format( 'F Y' ),
'request_date' => $request_date->format_i18n( 'F Y' ),
'prev_url' => $template->get( 'prev_url' ),
'next_url' => $template->get( 'next_url' )
];
$template_vars = array_merge( $this->get_template_vars(), $new_vars );
return $this->get_shortcode_template()->template( 'components/month-top-bar', $template_vars, false );
}
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |