* [your-theme]/tribe/events/v2/list/event/venue.php
*
* See more documentation about our views templating system.
*
* @link http://evnt.is/1aiy
*
* @version 4.9.11
*
* @var WP_Post $event The event post object with properties added by the `tribe_get_event` function.
*
* @see tribe_get_event() For the format of the event object.
*/
if (!$event->venues->count()) {
return;
}
$separator = esc_html_x(', ', 'Address separator', 'the-events-calendar');
$venue = $event->venues[0];
$append_after_address = array_filter(array_map('trim', [$venue->state_province, $venue->state, $venue->province]));
$address = $venue->address . ($venue->address && ($append_after_address || $venue->city) ? $separator : '');
?>
<div class="tribe-events-calendar-list__event-venue-title">
<i class="fa-sharp fa-solid fa-location-dot"></i> <?php echo wp_kses_post($venue->post_title); ?>
</div>
* [your-theme]/tribe/events/v2/list/event/venue.php
*
* See more documentation about our views templating system.
*
* @link http://evnt.is/1aiy
*
* @version 4.9.11
*
* @var WP_Post $event The event post object with properties added by the `tribe_get_event` function.
*
* @see tribe_get_event() For the format of the event object.
*/
if (!$event->venues->count()) {
return;
}
$separator = esc_html_x(', ', 'Address separator', 'the-events-calendar');
$venue = $event->venues[0];
$append_after_address = array_filter(array_map('trim', [$venue->state_province, $venue->state, $venue->province]));
$address = $venue->address . ($venue->address && ($append_after_address || $venue->city) ? $separator : '');
?>
<div class="tribe-events-calendar-list__event-venue-title">
<i class="fa-sharp fa-solid fa-location-dot"></i> <?php echo wp_kses_post($venue->post_title); ?>
</div>
*
* @since 4.11.0
*
* @param string $file Which file will be included with safe context.
*
* @return string Contents of the included file.
*/
public function template_safe_include( $file ) {
ob_start();
// We use this instance variable to prevent collisions.
$this->template_current_file_path = $file;
unset( $file );
// Only do this if really needed (by default it won't).
if ( true === $this->template_context_extract && ! empty( $this->context ) ) {
// Make any provided variables available in the template variable scope.
extract( $this->context ); // @phpcs:ignore
}
include $this->template_current_file_path;
// After the include we reset the variable.
unset( $this->template_current_file_path );
return ob_get_clean();
}
/**
* Sets a number of values at the same time.
*
* @since 4.9.11
*
* @param array $values An associative key/value array of the values to set.
* @param bool $is_local Whether to set the values as global or local; defaults to local as the `set` method does.
*
* @see Tribe__Template::set()
*/
public function set_values( array $values = [], $is_local = true ) {
foreach ( $values as $key => $value ) {
$this->set( $key, $value, $is_local );
}
*
* @since 4.11.0
* @since 5.2.0 Added the `$context` parameter; take charge of rendering the filtered HTML.
*
* @param string $html The initial HTML
* @param string $file Complete path to include the PHP File
* @param array $name Template name
* @param self $template Current instance of the Tribe__Template
* @param array<string,mixed> $context The context data passed to the template.
*/
$html = apply_filters( "tribe_template_pre_html:{$hook_name}", $html, $file, $name, $this, $context );
if ( null === $html ) {
// Merges the local data passed to template to the global scope
$this->merge_context( $context, $file, $name );
$before_include_html = $this->actions_before_template( $file, $name, $hook_name );
$before_include_html = $this->filter_template_before_include_html( $before_include_html, $file, $name, $hook_name );
$include_html = $this->template_safe_include( $file );
$include_html = $this->filter_template_include_html( $include_html, $file, $name, $hook_name );
$after_include_html = $this->actions_after_template( $file, $name, $hook_name );
$after_include_html = $this->filter_template_after_include_html( $after_include_html, $file, $name, $hook_name );
// Only fetch the contents after the action
$html = $before_include_html . $include_html . $after_include_html;
$html = $this->filter_template_html( $html, $file, $name, $hook_name );
// Tries to hook container entry points in the HTML.
$html = $this->template_hook_container_entry_points( $html );
}
if ( $echo ) {
echo $html;
}
// Revert the current hook name.
$this->set_template_current_hook_name( $prev_hook_name );
<div class="g-block size-33-3">
<section class="entry-content">
<?php $this->template('list/event/date', ['event' => $event]); ?>
<div class="post-thumbnail">
<?php
if (function_exists('get_user_favorites')) {
echo $favorites;
}
?>
<?php $this->template('list/event/featured-image', ['event' => $event]); ?>
<?php if ($primary_term_name) : ?>
<div class="cats-list"><?php echo esc_html($primary_term_name) ?></div>
<?php endif; ?>
</div>
<div class="entry-title-shell">
<?php $this->template('list/event/title', ['event' => $event]); ?>
<?php $this->template('list/event/venue', ['event' => $event]); ?>
</div>
</section>
</div>
*
* @since 4.11.0
*
* @param string $file Which file will be included with safe context.
*
* @return string Contents of the included file.
*/
public function template_safe_include( $file ) {
ob_start();
// We use this instance variable to prevent collisions.
$this->template_current_file_path = $file;
unset( $file );
// Only do this if really needed (by default it won't).
if ( true === $this->template_context_extract && ! empty( $this->context ) ) {
// Make any provided variables available in the template variable scope.
extract( $this->context ); // @phpcs:ignore
}
include $this->template_current_file_path;
// After the include we reset the variable.
unset( $this->template_current_file_path );
return ob_get_clean();
}
/**
* Sets a number of values at the same time.
*
* @since 4.9.11
*
* @param array $values An associative key/value array of the values to set.
* @param bool $is_local Whether to set the values as global or local; defaults to local as the `set` method does.
*
* @see Tribe__Template::set()
*/
public function set_values( array $values = [], $is_local = true ) {
foreach ( $values as $key => $value ) {
$this->set( $key, $value, $is_local );
}
*
* @since 4.11.0
* @since 5.2.0 Added the `$context` parameter; take charge of rendering the filtered HTML.
*
* @param string $html The initial HTML
* @param string $file Complete path to include the PHP File
* @param array $name Template name
* @param self $template Current instance of the Tribe__Template
* @param array<string,mixed> $context The context data passed to the template.
*/
$html = apply_filters( "tribe_template_pre_html:{$hook_name}", $html, $file, $name, $this, $context );
if ( null === $html ) {
// Merges the local data passed to template to the global scope
$this->merge_context( $context, $file, $name );
$before_include_html = $this->actions_before_template( $file, $name, $hook_name );
$before_include_html = $this->filter_template_before_include_html( $before_include_html, $file, $name, $hook_name );
$include_html = $this->template_safe_include( $file );
$include_html = $this->filter_template_include_html( $include_html, $file, $name, $hook_name );
$after_include_html = $this->actions_after_template( $file, $name, $hook_name );
$after_include_html = $this->filter_template_after_include_html( $after_include_html, $file, $name, $hook_name );
// Only fetch the contents after the action
$html = $before_include_html . $include_html . $after_include_html;
$html = $this->filter_template_html( $html, $file, $name, $hook_name );
// Tries to hook container entry points in the HTML.
$html = $this->template_hook_container_entry_points( $html );
}
if ( $echo ) {
echo $html;
}
// Revert the current hook name.
$this->set_template_current_hook_name( $prev_hook_name );
<header <?php tribe_classes($header_classes); ?>>
<?php $this->template('components/messages'); ?>
<?php $this->template('components/messages', ['classes' => ['tribe-events-header__messages--mobile']]); ?>
<?php $this->template('components/breadcrumbs'); ?>
<?php $this->template('components/events-bar'); ?>
<?php $this->template('list/top-bar'); ?>
</header>
<?php $this->template('components/filter-bar'); ?>
<div class="tribe-events-calendar-list g-grid">
<?php foreach ($events as $event) : ?>
<?php $this->setup_postdata($event); ?>
<?php $this->template('list/event', ['event' => $event]); ?>
<?php endforeach; ?>
</div>
<?php $this->template('list/nav'); ?>
<?php $this->template('components/ical-link'); ?>
<?php $this->template('components/after'); ?>
</div>
</div>
<?php $this->template('components/breakpoints'); ?>
*
* @since 4.11.0
*
* @param string $file Which file will be included with safe context.
*
* @return string Contents of the included file.
*/
public function template_safe_include( $file ) {
ob_start();
// We use this instance variable to prevent collisions.
$this->template_current_file_path = $file;
unset( $file );
// Only do this if really needed (by default it won't).
if ( true === $this->template_context_extract && ! empty( $this->context ) ) {
// Make any provided variables available in the template variable scope.
extract( $this->context ); // @phpcs:ignore
}
include $this->template_current_file_path;
// After the include we reset the variable.
unset( $this->template_current_file_path );
return ob_get_clean();
}
/**
* Sets a number of values at the same time.
*
* @since 4.9.11
*
* @param array $values An associative key/value array of the values to set.
* @param bool $is_local Whether to set the values as global or local; defaults to local as the `set` method does.
*
* @see Tribe__Template::set()
*/
public function set_values( array $values = [], $is_local = true ) {
foreach ( $values as $key => $value ) {
$this->set( $key, $value, $is_local );
}
*
* @since 4.11.0
* @since 5.2.0 Added the `$context` parameter; take charge of rendering the filtered HTML.
*
* @param string $html The initial HTML
* @param string $file Complete path to include the PHP File
* @param array $name Template name
* @param self $template Current instance of the Tribe__Template
* @param array<string,mixed> $context The context data passed to the template.
*/
$html = apply_filters( "tribe_template_pre_html:{$hook_name}", $html, $file, $name, $this, $context );
if ( null === $html ) {
// Merges the local data passed to template to the global scope
$this->merge_context( $context, $file, $name );
$before_include_html = $this->actions_before_template( $file, $name, $hook_name );
$before_include_html = $this->filter_template_before_include_html( $before_include_html, $file, $name, $hook_name );
$include_html = $this->template_safe_include( $file );
$include_html = $this->filter_template_include_html( $include_html, $file, $name, $hook_name );
$after_include_html = $this->actions_after_template( $file, $name, $hook_name );
$after_include_html = $this->filter_template_after_include_html( $after_include_html, $file, $name, $hook_name );
// Only fetch the contents after the action
$html = $before_include_html . $include_html . $after_include_html;
$html = $this->filter_template_html( $html, $file, $name, $hook_name );
// Tries to hook container entry points in the HTML.
$html = $this->template_hook_container_entry_points( $html );
}
if ( $echo ) {
echo $html;
}
// Revert the current hook name.
$this->set_template_current_hook_name( $prev_hook_name );
*
* @since 4.9.2
*
* @param array $context_overrides Any context data you need to expose to this file
*
* @return string The rendered template contents.
*/
public function render( array $context_overrides = [] ) {
$context = wp_parse_args( $context_overrides, $this->context );
$context['_context'] = $context;
$template_slug = $this->view->get_template_slug();
if ( ! empty( $this->view->get_template_path() ) ) {
$template_slug = [
$this->view->get_template_path(),
$template_slug,
];
}
return parent::template( $template_slug, $context, false );
}
/**
* Template constructor.
*
* @since 4.9.2
* @since 4.9.4 Modified the first param to only accept View_Interface instances.
*
* @param View_Interface $view The view the template should use to build its path.
*
*/
public function __construct( $view ) {
$this->set_view( $view );
$this->set_template_origin( tribe( 'tec.main' ) )
->set_template_folder( 'src/views/v2' )
->set_template_folder_lookup( true )
->set_template_context_extract( true );
// Set some global defaults all Views are likely to search for; those will be overridden by each View.
return $cached_html . $nonce_html;
}
if ( ! tribe_events_view_v2_use_period_repository() ) {
$this->setup_the_loop( $repository_args );
}
/**
* Fire new action on the views.
*
* @since 5.7.0
*
* @param View $this A reference to the View instance that is currently setting up the loop.
*/
do_action( 'tribe_views_v2_after_setup_loop', $this );
$template_vars = $this->filter_template_vars( $this->setup_template_vars() );
$this->template->set_values( $template_vars, false );
$html = $this->template->render();
$this->restore_the_loop();
// If HTML_Cache is a class trait, perhaps the markup should be cached.
if ( method_exists( $this, 'maybe_cache_html' ) ) {
$this->maybe_cache_html( $html );
}
remove_filter( 'tribe_repository_query_arg_offset_override', [ $this, 'filter_repository_query_arg_offset_override' ], 10, 2 );
remove_filter( 'tec_events_get_current_view', [ $this, 'filter_set_current_view' ] );
return $html . $nonce_html;
}
/**
* Returns the view label value after filtering.
*
* This is the method you want to overwrite to replace the label for a view with translations.
*
* @since 6.0.4
*
if ( ! is_array( $ids ) ) {
return;
}
$this->post_id = array_filter( array_map( 'absint', $ids ) );;
}
/**
* {@inheritDoc}
*/
public function get_html() {
/*
* Since this view has historically being rendered with the `list` one let's allow developers to define
* templates for the `all` view, but fallback on the `list` one if not found.
*/
if ( $this->template->get_base_template_file() === $this->template->get_template_file() ) {
$this->template_slug = \Tribe\Events\Views\V2\Views\List_View::get_view_slug();
}
return parent::get_html();
}
/**
* {@inheritDoc}
*/
public function prev_url( $canonical = false, array $passthru_vars = [] ) {
$cache_key = __METHOD__ . '_' . md5( wp_json_encode( func_get_args() ) );
if ( isset( $this->cached_urls[ $cache_key ] ) ) {
return $this->cached_urls[ $cache_key ];
}
$current_page = (int) $this->context->get( 'page', 1 );
$display = $this->context->get( 'event_display_mode', 'venue' );
if ( 'past' === $display ) {
$url = View::next_url( $canonical, [ Utils\View::get_past_event_display_key() => 'past' ] );
} elseif ( $current_page > 1 ) {
$url = View::prev_url( $canonical );
} else {
$template = Arr::get( $context['query']->query_vars, 'tribe_events_views_kitchen_sink', 'page' );
if ( ! in_array( $template, tribe( Kitchen_Sink::class )->get_available_pages() ) ) {
$template = 'page';
}
$html = tribe( Kitchen_Sink::class )->template( $template, $context, false );
} else {
/**
* Filters the slug of the view that will be loaded, to allow changing view based on the context of a given
* request.
*
* @since 4.9.11
*
* @param string $view_slug The slug of the View that will be built, based on the context.
* @param \Tribe__Context $context Tribe context used to setup the view.
* @param \WP_Query $query The current WP Query object.
*/
$view_slug = apply_filters( 'tribe_events_views_v2_bootstrap_view_slug', $view_slug, $context, $query );
$html = View::make( $view_slug, $context )->get_html();
}
/**
* Filters the HTML for the view before we do any other logic around that.
*
* @since 5.0.0
*
* @param string $html The html to be displayed.
* @param \Tribe__Context $context Tribe context used to setup the view.
* @param string $view_slug The slug of the View that we've built,
* based on the context but possibly altered in the build process.
* @param \WP_Query $query The current WP Query object.
*/
return apply_filters( 'tribe_events_views_v2_bootstrap_html', $html, $context, $view_slug, $query );
}
/**
* Determines when we should bootstrap the template for The Events Calendar
*
<?php
/**
* View: Default Template for Events
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe/events/v2/default-template.php
*
* See more documentation about our views templating system.
*
* @link http://evnt.is/1aiy
*
* @version 5.0.0
*/
use Tribe\Events\Views\V2\Template_Bootstrap;
get_header();
echo tribe( Template_Bootstrap::class )->get_view_html();
get_footer();
}
break;
}
}
if ( ! $template ) {
$template = get_index_template();
}
/**
* Filters the path of the current template before including it.
*
* @since 3.0.0
*
* @param string $template The path of the template to include.
*/
$template = apply_filters( 'template_include', $template );
if ( $template ) {
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';