Tribe_Events::filter_view_data( TribeEventsProViewsV2Shortcodesarray $data, string $slug, TribeEventsViewsV2View_Interface $view )
Filters the View data attributes to add some related to PRO features.
Contents
Parameters
- $data
-
(<span class="TribeEventsProViewsV2Shortcodesarray">TribeEventsProViewsV2Shortcodesarray) (Required) The current View data attributes classes.
- $slug
-
(string) (Required) The View registered slug.
- $view
-
(TribeEventsViewsV2View_Interface) (Required) The View currently rendering.
Return
(TribeEventsProViewsV2Shortcodesarray<string,string>) The filtered data attributes.
Source
File: src/Tribe/Views/V2/Shortcodes/Tribe_Events.php
public function filter_view_data( $data, $slug, $view ) {
$context = $view->get_context();
if ( ! $context instanceof Context ) {
return $data;
}
if ( $shortcode = $context->get( 'shortcode', false ) ) {
$data['shortcode'] = $shortcode;
}
return $data;
}
Changelog
| Version | Description |
|---|---|
| 5.0.0 | Introduced. |