tribe_is_view( $view = false )
Checks whether we’re on a particular view
Contents
Return
(bool)
More Information
Added: October 8, 2020
If you would like to do something on a specific view, for example the month view, then you could do something like this:
if ( tribe_is_view( 'month' ) ) {
// Your code goes here
}
Note, while this might work, this only looks up only a part of the information. Using tribe_context(), especially when using V2 views is recommended:
if ( tribe_context()->get( 'view_request' ) === 'month' ) {
// Your code goes here
}
Source
File: src/functions/template-tags/loop.php
function tribe_is_view( $view = false ) {
return $view === Tribe__Events__Main::instance()->displaying;
}