tec_events_get_today_button_label( TribeEventsViewsV2View_Interface $view = null )
Get the filtered text label for the “Today” button on calendar views.
Contents
Parameters
- $view
-
(TribeEventsViewsV2View_Interface) (Optional) The View currently rendering. Hint: In templates, you can call $this->get_view() to get the view.
Default value: null
Return
(string) The label for the "Today" button.
Source
File: src/functions/template-tags/general.php
function tec_events_get_today_button_label( $view = null ) {
$today = esc_html_x(
'Today',
'The default text label for the "today" button on main calendar views.',
'the-events-calendar'
);
/**
* Allows filtering of all labels for the today button at one time.
*
* @since 6.0.2
*
* @param string $today The string used for the "Today" button on calendar views.
* @param \Tribe\Events\Views\V2\View_Interface $view The View currently rendering.
*/
$today = apply_filters( 'tec_events_today_button_label', $today, $view );
// If we don't have the view - send it off!
if ( empty( $view ) ) {
return $today;
}
$view_slug = $view::get_view_slug();
/**
* Allows filtering a view-specific label for the today button.
*
* @since 6.0.2
*
* @param string $today The string used for the "Today" button on calendar views.
* @param \Tribe\Events\Views\V2\View_Interface $view The View currently rendering.
*/
return apply_filters( "tec_events_view_{$view_slug}_today_button_label", $today, $view );
}
Changelog
| Version | Description |
|---|---|
| 6.0.2 | Introduced. |