Hooks::filter_bootstrap_view_slug( string $slug, Tribe__Context $context )
Filters the slug of the view that will be built according to the request context to add support for Venue and Organizer Views.
Contents
Parameters
- $slug
-
(string) (Required) The View slug that would be loaded.
- $context
-
(Tribe__Context) (Required) The current request context.
Return
(string) The filtered View slug, set to the Venue or Organizer ones, if required.
Source
File: src/Tribe/Views/V2/Hooks.php
public function filter_bootstrap_view_slug( $slug, $context ) {
$post_types = [
Organizer::POSTTYPE => 'organizer',
Venue::POSTTYPE => 'venue',
];
$post_type = $context->get( 'post_type', $slug );
return isset( $post_types[ $post_type ] ) ? $post_types[ $post_type ] : $slug;
}
Changelog
| Version | Description |
|---|---|
| 6.0.5 | Moved the logic to th the TribeEventsProViewsV2View_Filters class. |
| 4.7.9 | Introduced. |