<a href="https://www.facebook.com/sharer/sharer.php?u={{ function('eo_get_permalink')|url_encode }}" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=600'); return false;" target="_blank" title="Share on Facebook">
<svg width="42" height="42" viewBox="0 0 36 36"><path class="icon_back" fill="#000" d="M0 2.842v30.314a2.841 2.841 0 0 0 2.842 2.842h30.314a2.841 2.841 0 0 0 2.842-2.842V2.842A2.841 2.841 0 0 0 33.156 0H2.842A2.841 2.841 0 0 0 0 2.842Z" /><path fill="#fff" d="M 15.1 35.7 L 15.1 23 L 10.6 23 L 10.6 18 L 15.1 18 L 15.1 14 C 15.1 9.5 18 7 22.1 7 C 23.4 7 24.8 7.2 26.1 7.4 L 26.1 12 L 23.8 12 C 21.6 12 21.1 13.1 21.1 14.5 L 21.1 18 L 25.8 18 L 25 23 L 21.1 23 L 21.1 35.7 C 19.6 36 16.6 36 15.1 35.7 Z" /></svg>
</a>
</div>
<div class="social-program twitter-icon">
<a href="https://twitter.com/share?url={{ function('eo_get_permalink')|url_encode }}" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=600'); return false;" target="_blank" title="Share on Twitter">
<svg width="42" height="42" viewBox="0 0 36 36"><path class="icon_back" fill="#000" d="M0 2.842v30.314a2.841 2.841 0 0 0 2.842 2.842h30.314a2.841 2.841 0 0 0 2.842-2.842V2.842A2.841 2.841 0 0 0 33.156 0H2.842A2.841 2.841 0 0 0 0 2.842Z" /><path fill="#fff" d="M 6.2 25.9 C 15.4 32.3 29.1 24.5 28 13.3 C 29 12.6 29.9 11.7 30.5 10.7 C 29.6 11.1 28.7 11.4 27.7 11.5 C 28.7 10.9 29.5 9.9 29.9 8.7 C 28.9 9.3 27.8 9.7 26.7 9.9 C 23.5 6.1 16.8 9.8 18.2 14.5 C 14.2 14.3 10.4 12.4 7.9 9.3 C 6.6 11.6 7.3 14.5 9.5 15.9 C 8.7 15.9 7.9 15.7 7.2 15.3 C 7.1 17.7 8.9 19.8 11.2 20.3 C 10.5 20.5 9.7 20.4 8.9 20.4 C 9.6 22.4 11.5 23.8 13.6 23.8 C 11.5 25.5 8.8 26.2 6.2 25.9 Z" /></svg>
</a>
</div>
<div class="social-program email-icon">
<a href="mailto:?subject={{ post.title|url_encode }}&body={{ function('eo_get_permalink')|url_encode }}" target="_blank" title="Share via E-mail">
<svg width="42" height="42" viewBox="0 0 36 36"><path class="icon_back" d="M0 2.842v30.314a2.841 2.841 0 0 0 2.842 2.842h30.314a2.841 2.841 0 0 0 2.842-2.842V2.842A2.841 2.841 0 0 0 33.156 0H2.842A2.841 2.841 0 0 0 0 2.842Z" /><path d="m5.341 27.599 8.556 -8.537 0.78 0.777c2.268 2.327 4.593 2.036 6.639 0.004l0.783 -0.78 8.556 8.537a2.365 2.365 0 0 1 -1.017 0.229H6.361c-0.365 0 -0.712 -0.083 -1.02 -0.231Zm26.392 -1.043 -8.572 -8.553L31.733 9.449c0.169 0.325 0.265 0.693 0.265 1.084v14.935c0 0.392 -0.096 0.763 -0.265 1.088ZM4 25.468V10.533c0 -0.391 0.095 -0.759 0.263 -1.084l8.572 8.552 -8.571 8.552A2.336 2.336 0 0 1 4 25.468Zm11.745 -6.684 -1.316 -1.312 -9.088 -9.068c0.308 -0.148 0.655 -0.232 1.02 -0.232h23.276c0.364 0 0.711 0.084 1.019 0.232l-9.037 9.019 -0.052 0.048a0.807 0.807 0 0 0 -0.047 0.051l-1.261 1.259c-1.513 1.501 -2.879 1.683 -4.513 0.004Z"/></svg>
</a>
</div>
</div>
</div>
<div class="grid justify-items-center">
<div class="uppercase tracking-wide pb-2">Add to calendar</div>
<div class="gcal-icon">
<a href="{{ function('eo_get_add_to_google_link') }}" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=600'); return false;" target="_blank" title="Add to Google Calendar">
<svg width="42" height="42" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 27"><path fill="#1967d2" d="M27 6.4V2.1C27 1 26 0 24.9 0h-4.3v6.4H27Z"/><path fill="#188038" d="M0 20.6V25C0 26 1 27 2.1 27h4.3v-6.4H0Z"/><path fill="#34a853" d="M6.4 27v-6.4h14.2V27H6.4Z"/><path fill="#4285f4" d="M0 20.6V2.1C0 1 1 0 2.1 0h18.5v6.4H6.4v14.2H0Z"/><path fill="#fbbc04" d="M20.6 20.6V6.4H27v14.2h-6.4Z"/><path fill="#ea4335" d="M20.6 27v-6.4H27L20.6 27Z"/><path fill="#1967d2" d="M12.7 18v-3.7H9v-1.6h3.7V9h1.6v3.7H18v1.6h-3.7V18h-1.6Z"/></svg>
</a>
</div>
</div>
* * {@see `eo_get_the_start()`}
* * {@see `eo_get_the_end()`}
* * {@see `eo_get_schedule_start()`}
* * {@see `eo_get_schedule_last()`}
*
* The constant DATETIMEOBJ can be passed to them to get datetime objects
* Applies {@see `eventorganiser_format_datetime`} filter
*
* @since 1.2.0
* @link https://php.net/manual/en/function.date.php PHP Date
*
* @param dateTime $datetime The datetime to format
* @param string|constant $format How to format the date, see https://php.net/manual/en/function.date.php or DATETIMEOBJ constant to return the datetime object.
* @return string|dateTime The formatted date
*/
function eo_format_datetime( $datetime, $format = 'd-m-Y' ) {
global $wp_locale;
if ( ! ( $datetime instanceof DateTime ) ) {
throw new Exception( sprintf(
'Error in formating DateTime object. Expected DateTime, but instead given %s',
gettype( $datetime )
) );
}
if ( DATETIMEOBJ == $format ) {
return $datetime;
}
if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) :
//Translate
$datemonth = $wp_locale->get_month( $datetime->format( 'm' ) );
$datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );
$dateweekday = $wp_locale->get_weekday( $datetime->format( 'w' ) );
$dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );
$datemeridiem = trim($wp_locale->get_meridiem( $datetime->format( 'a' ) ) );
$datemeridiem_capital = trim( $wp_locale->get_meridiem( $datetime->format( 'A' ) ) );
$datemeridiem = ( empty( $datemeridiem ) ? $datetime->format( 'a' ) : $datemeridiem );
$datemeridiem_capital = ( empty( $datemeridiem_capital ) ? $datetime->format( 'A' ) : $datemeridiem_capital );
* @param string $date_format How to format the date part of the occurrence's datetime.
* @param string $time_format How to format the time part of the occurrence's datetime.
* @param string $seperator A string used to seperate differing parts of the formatted start/end datetimes.
* @param bool $microdata Whether to wrap the formatted start/end datetimes in microdata
* @return string|dateTime The formatted occurrence start/end date range
*/
function eo_format_event_occurrence( $event_id = false, $occurrence_id = false, $date_format = false, $time_format = false, $seperator = ' – ', $microdata = true ){
global $post;
$event_id = $event_id ? intval( $event_id ) : get_the_ID();
$occurrence_id = $occurrence_id ? intval( $occurrence_id ) : intval( $post->occurrence_id );
$format = eo_get_event_datetime_format( $event_id, $date_format, $time_format );
$microformat = eo_is_all_day( $event_id ) ? 'Y-m-d' : 'c';
$start = eo_get_the_start( DATETIMEOBJ, $event_id, null, $occurrence_id );
$end = eo_get_the_end( DATETIMEOBJ, $event_id, null, $occurrence_id );
$start_formatted = eo_format_datetime( $start, $format );
$end_formatted = eo_format_datetime( $end, $format );
if( $start_formatted == $end_formatted ){
$end_formatted = false;
}else{
$fragment = _eo_format_datetime_range( $start, $end, $format, is_rtl() );
$start_formatted = is_rtl() ? $fragment['right'] : $fragment['left'];
$end_formatted = is_rtl() ? $fragment['left'] : $fragment['right'];
}
if( $microdata ){
$start_formatted = sprintf(
'<time itemprop="startDate" datetime="%s">%s</time>',
$start->format( $microformat ),
$start_formatted
);
if( $end_formatted ){
$end_formatted = sprintf(
<!-- Is event recurring or a single event -->
<?php if ( eo_recurs() ) :?>
<!-- Event recurs - is there a next occurrence? -->
<?php $next = eo_get_next_occurrence( eo_get_event_datetime_format() );?>
<?php if ( $next ) : ?>
<!-- If the event is occurring again in the future, display the date -->
<?php printf( '<p>' . __( 'This event is running from %1$s until %2$s. It is next occurring on %3$s', 'eventorganiser' ) . '</p>', eo_get_schedule_start( 'j F Y' ), eo_get_schedule_last( 'j F Y' ), $next );?>
<?php else : ?>
<!-- Otherwise the event has finished (no more occurrences) -->
<?php printf( '<p>' . __( 'This event finished on %s', 'eventorganiser' ) . '</p>', eo_get_schedule_last( 'd F Y', '' ) );?>
<?php endif; ?>
<?php endif; ?>
<ul class="eo-event-meta">
<?php if ( ! eo_recurs() ) { ?>
<!-- Single event -->
<li><strong><?php esc_html_e( 'Date', 'eventorganiser' );?>:</strong> <?php echo eo_format_event_occurrence();?></li>
<?php } ?>
<?php if ( eo_get_venue() ) {
$tax = get_taxonomy( 'event-venue' ); ?>
<li><strong><?php echo esc_html( $tax->labels->singular_name ) ?>:</strong> <a href="<?php eo_venue_link(); ?>"> <?php eo_venue_name(); ?></a></li>
<?php } ?>
<?php if ( get_the_terms( get_the_ID(), 'event-category' ) && ! is_wp_error( get_the_terms( get_the_ID(), 'event-category' ) ) ) { ?>
<li><strong><?php esc_html_e( 'Categories', 'eventorganiser' ); ?>:</strong> <?php echo get_the_term_list( get_the_ID(),'event-category', '', ', ', '' ); ?></li>
<?php } ?>
<?php if ( get_the_terms( get_the_ID(), 'event-tag' ) && ! is_wp_error( get_the_terms( get_the_ID(), 'event-tag' ) ) ) { ?>
<li><strong><?php esc_html_e( 'Tags', 'eventorganiser' ); ?>:</strong> <?php echo get_the_term_list( get_the_ID(), 'event-tag', '', ', ', '' ); ?></li>
<?php } ?>
<?php if ( eo_recurs() ) {
//Event recurs - display dates.
$upcoming = new WP_Query(array(
'post_type' => 'event',
'event_start_after' => 'today',
if ( isset( $s ) ) {
$s = esc_attr( $s );
}
/**
* Fires before a template file is loaded.
*
* @since 6.1.0
*
* @param string $_template_file The full path to the template file.
* @param bool $load_once Whether to require_once or require.
* @param array $args Additional arguments passed to the template.
*/
do_action( 'wp_before_load_template', $_template_file, $load_once, $args );
if ( $load_once ) {
require_once $_template_file;
} else {
require $_template_file;
}
/**
* Fires after a template file is loaded.
*
* @since 6.1.0
*
* @param string $_template_file The full path to the template file.
* @param bool $load_once Whether to require_once or require.
* @param array $args Additional arguments passed to the template.
*/
do_action( 'wp_after_load_template', $_template_file, $load_once, $args );
}
*
* @param array $stack Array of directories (absolute path).
*/
$stack = apply_filters( 'eventorganiser_template_stack', $stack );
$stack = array_unique( $stack );
foreach ( (array) $template_names as $template_name ) {
if ( ! $template_name ) {
continue;
}
foreach ( $stack as $template_stack ) {
if ( file_exists( trailingslashit( $template_stack ) . $template_name ) ) {
$located = trailingslashit( $template_stack ) . $template_name;
break 2;
}
}
}
if ( $load && '' != $located ) {
load_template( $located, $require_once );
}
return $located;
}
/**
* A wrapper for {@see wp_enqueue_style()}. Filters the stylesheet url so themes can
* replace a stylesheet with their own.
*
* @uses wp_register_style()
* @since 3.0.0
*
* @param string $handle Name of the stylesheet.
* @param string|bool $src Path to the stylesheet from the WordPress root directory. Example: '/css/mystyle.css'.
* @param array $deps An array of registered style handles this stylesheet depends on. Default empty array.
* @param string|bool $ver String specifying the stylesheet version number. Used to ensure that the correct version
* is sent to the client regardless of caching. Default 'false'. Accepts 'false', 'null', or 'string'.
* @param string $media Optional. The media for which this stylesheet has been defined.
* Default 'all'. Accepts 'all', 'aural', 'braille', 'handheld', 'projection', 'print',
* 'screen', 'tty', or 'tv'.
* @uses do_action() Calls `get_template_part_{$slug}` action.
*
* @param string $slug The slug name for the generic template.
* @param string $name The name of the specialised template.
*/
function eo_get_template_part( $slug, $name = null ) {
/**
* @ignore
*/
do_action( "get_template_part_{$slug}", $slug, $name );
$templates = array();
if ( isset( $name ) ) {
$templates[] = "{$slug}-{$name}.php";
}
$templates[] = "{$slug}.php";
eo_locate_template( $templates, true, false );
}
/**
* Retrieve the name of the highest priority template file that exists.
*
* Searches the child theme first, then the parent theme before checking the plug-in templates folder.
* So parent themes can override the default plug-in templates, and child themes can over-ride both.
*
* Behaves almost identically to `{@see locate_template()}`
*
* @since 1.7
*
* @param string|array $template_names Template file(s) to search for, in order.
* @param bool $load If true the template file will be loaded if it is found.
* @param bool $require_once Whether to require_once or require. Default true. Has no effect if $load is false.
* @return string The template filename if one is located.
*/
function eo_locate_template( $template_names, $load = false, $require_once = true ) {
$located = '';
//Check we are an event!
if ( get_post_type( get_the_ID() ) !== 'event' ) {
return $content;
}
/*
* This was introduced to fix an obscure bug with including pages
* in another page via shortcodes.
* But it breaks yoast SEO.
global $eo_event_parsed;
if( !empty( $eo_event_parsed[get_the_ID()] ) ){
return $content;
}else{
$eo_event_parsed[get_the_ID()] = 1;
}*/
//Object buffering
ob_start();
eo_get_template_part( 'event-meta','event-single' );
//include(EVENT_ORGANISER_DIR.'templates/event-meta-event-single.php');
$event_details = ob_get_contents();
ob_end_clean();
/**
* Filters the event details automatically appended to the event's content
* when single-event.php is not present in the theme.
*
* If template handling is enabled and the theme does not have `single-event.php`
* template, Event Organiser uses `the_content` filter to add prepend the content
* with event details. This filter allows you to change the prepended details.
*
* Unless you have a good reason, it's strongly recommended to change the templates
* rather than use this filter.
*
* @param string $event_details The event details to be added.
* @param string $content The original event content
*/
$event_details = apply_filters( 'eventorganiser_pre_event_content', $event_details, $content );
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
$text = strip_shortcodes( $text );
$text = excerpt_remove_blocks( $text );
$text = excerpt_remove_footnotes( $text );
/*
* Temporarily unhook wp_filter_content_tags() since any tags
* within the excerpt are stripped out. Modifying the tags here
* is wasteful and can lead to bugs in the image counting logic.
*/
$filter_image_removed = remove_filter( 'the_content', 'wp_filter_content_tags', 12 );
/*
* Temporarily unhook do_blocks() since excerpt_remove_blocks( $text )
* handles block rendering needed for excerpt.
*/
$filter_block_removed = remove_filter( 'the_content', 'do_blocks', 9 );
/** This filter is documented in wp-includes/post-template.php */
$text = apply_filters( 'the_content', $text );
$text = str_replace( ']]>', ']]>', $text );
// Restore the original filter if removed.
if ( $filter_block_removed ) {
add_filter( 'the_content', 'do_blocks', 9 );
}
/*
* Only restore the filter callback if it was removed above. The logic
* to unhook and restore only applies on the default priority of 10,
* which is generally used for the filter callback in WordPress core.
*/
if ( $filter_image_removed ) {
add_filter( 'the_content', 'wp_filter_content_tags', 12 );
}
/* translators: Maximum number of words used in a post excerpt. */
$excerpt_length = (int) _x( '55', 'excerpt_length' );
/**
$this->iterations[ $nesting_level ] = $this->priorities;
$num_args = count( $args );
do {
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
$priority = $this->current_priority[ $nesting_level ];
foreach ( $this->callbacks[ $priority ] as $the_ ) {
if ( ! $this->doing_action ) {
$args[0] = $value;
}
// Avoid the array_slice() if possible.
if ( 0 === $the_['accepted_args'] ) {
$value = call_user_func( $the_['function'] );
} elseif ( $the_['accepted_args'] >= $num_args ) {
$value = call_user_func_array( $the_['function'], $args );
} else {
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, $the_['accepted_args'] ) );
}
}
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
unset( $this->iterations[ $nesting_level ] );
unset( $this->current_priority[ $nesting_level ] );
--$this->nesting_level;
return $value;
}
/**
* Calls the callback functions that have been added to an action hook.
*
* @since 4.7.0
*
* @param array $args Parameters to pass to the callback functions.
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->apply_filters( $value, $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
*
* @since 3.0.0
*
* @see apply_filters() This function is identical, but the arguments passed to the
* functions hooked to `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter was triggered.
* @global string[] $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $hook_name The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
$post = get_post( $post );
if ( empty( $post ) ) {
return '';
}
if ( post_password_required( $post ) ) {
return __( 'There is no excerpt because this is a protected post.' );
}
/**
* Filters the retrieved post excerpt.
*
* @since 1.2.0
* @since 4.5.0 Introduced the `$post` parameter.
*
* @param string $post_excerpt The post excerpt.
* @param WP_Post $post Post object.
*/
return apply_filters( 'get_the_excerpt', $post->post_excerpt, $post );
}
/**
* Determines whether the post has a custom excerpt.
*
* For more information on this and similar theme functions, check out
* the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
* Conditional Tags} article in the Theme Developer Handbook.
*
* @since 2.3.0
*
* @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
* @return bool True if the post has a custom excerpt, false otherwise.
*/
function has_excerpt( $post = 0 ) {
$post = get_post( $post );
return ( ! empty( $post->post_excerpt ) );
}
/**
}
setup_postdata( $post );
$start = clone eo_get_the_start( DATETIMEOBJ, $event_id, $occurrence_id );
$end = clone eo_get_the_end( DATETIMEOBJ, $event_id, $occurrence_id );
if( eo_is_all_day() ):
$end->modify( '+1 second' );
$format = 'Ymd';
else:
$format = 'Ymd\THis\Z';
$start->setTimezone( new DateTimeZone( 'UTC' ) );
$end->setTimezone( new DateTimeZone( 'UTC' ) );
endif;
/**
* @ignore
*/
$excerpt = apply_filters( 'the_excerpt_rss', get_the_excerpt() );
$venue = false;
$venue_id = eo_get_venue();
if ( $venue_id ) {
$venue = eo_get_venue_name( $venue_id ) . ", " . implode( ', ', eo_get_venue_address( $venue_id ) );
}
$url = add_query_arg( array(
'text' => get_the_title(),
'dates' => $start->format( $format ) . '/' . $end->format( $format ),
'details' => esc_html( $excerpt ),
'sprop' => get_bloginfo( 'name' ),
'location' => $venue,
), 'http://www.google.com/calendar/event?action=TEMPLATE' );
wp_reset_postdata();
return esc_url_raw( $url );
}
if ( is_array($arr) ) {
return $arr;
}
$arr = array($arr);
return $arr;
}
/**
*
*
* @param string $function_name
* @return mixed
*/
public function exec_function( $function_name ) {
$args = func_get_args();
array_shift($args);
if ( is_string($function_name) ) {
$function_name = trim($function_name);
}
return call_user_func_array($function_name, ($args));
}
/**
*
*
* @param string $content
* @return string
*/
public function twig_pretags( $content ) {
return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
}
/**
*
*
* @param array $matches
* @return string
*/
public function convert_pre_entities( $matches ) {
return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
if ( is_array($arr) ) {
return $arr;
}
$arr = array($arr);
return $arr;
}
/**
*
*
* @param string $function_name
* @return mixed
*/
public function exec_function( $function_name ) {
$args = func_get_args();
array_shift($args);
if ( is_string($function_name) ) {
$function_name = trim($function_name);
}
return call_user_func_array($function_name, ($args));
}
/**
*
*
* @param string $content
* @return string
*/
public function twig_pretags( $content ) {
return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
}
/**
*
*
* @param array $matches
* @return string
*/
public function convert_pre_entities( $matches ) {
return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
</a>
</div>
<div class=\"social-program email-icon\">
<a href=\"mailto:?subject=";
// line 24
echo twig_urlencode_filter($this->getAttribute(($context["post"] ?? null), "title", []));
echo "&body=";
echo twig_urlencode_filter(call_user_func_array($this->env->getFunction('function')->getCallable(), ["eo_get_permalink"]));
echo "\" target=\"_blank\" title=\"Share via E-mail\">
<svg width=\"42\" height=\"42\" viewBox=\"0 0 36 36\"><path class=\"icon_back\" d=\"M0 2.842v30.314a2.841 2.841 0 0 0 2.842 2.842h30.314a2.841 2.841 0 0 0 2.842-2.842V2.842A2.841 2.841 0 0 0 33.156 0H2.842A2.841 2.841 0 0 0 0 2.842Z\" /><path d=\"m5.341 27.599 8.556 -8.537 0.78 0.777c2.268 2.327 4.593 2.036 6.639 0.004l0.783 -0.78 8.556 8.537a2.365 2.365 0 0 1 -1.017 0.229H6.361c-0.365 0 -0.712 -0.083 -1.02 -0.231Zm26.392 -1.043 -8.572 -8.553L31.733 9.449c0.169 0.325 0.265 0.693 0.265 1.084v14.935c0 0.392 -0.096 0.763 -0.265 1.088ZM4 25.468V10.533c0 -0.391 0.095 -0.759 0.263 -1.084l8.572 8.552 -8.571 8.552A2.336 2.336 0 0 1 4 25.468Zm11.745 -6.684 -1.316 -1.312 -9.088 -9.068c0.308 -0.148 0.655 -0.232 1.02 -0.232h23.276c0.364 0 0.711 0.084 1.019 0.232l-9.037 9.019 -0.052 0.048a0.807 0.807 0 0 0 -0.047 0.051l-1.261 1.259c-1.513 1.501 -2.879 1.683 -4.513 0.004Z\"/></svg>
</a>
</div>
</div>
</div>
<div class=\"grid justify-items-center\">
<div class=\"uppercase tracking-wide pb-2\">Add to calendar</div>
<div class=\"gcal-icon\">
<a href=\"";
// line 33
echo call_user_func_array($this->env->getFunction('function')->getCallable(), ["eo_get_add_to_google_link"]);
echo "\" onclick=\"javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=600'); return false;\" target=\"_blank\" title=\"Add to Google Calendar\">
<svg width=\"42\" height=\"42\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 27 27\"><path fill=\"#1967d2\" d=\"M27 6.4V2.1C27 1 26 0 24.9 0h-4.3v6.4H27Z\"/><path fill=\"#188038\" d=\"M0 20.6V25C0 26 1 27 2.1 27h4.3v-6.4H0Z\"/><path fill=\"#34a853\" d=\"M6.4 27v-6.4h14.2V27H6.4Z\"/><path fill=\"#4285f4\" d=\"M0 20.6V2.1C0 1 1 0 2.1 0h18.5v6.4H6.4v14.2H0Z\"/><path fill=\"#fbbc04\" d=\"M20.6 20.6V6.4H27v14.2h-6.4Z\"/><path fill=\"#ea4335\" d=\"M20.6 27v-6.4H27L20.6 27Z\"/><path fill=\"#1967d2\" d=\"M12.7 18v-3.7H9v-1.6h3.7V9h1.6v3.7H18v1.6h-3.7V18h-1.6Z\"/></svg>
</a>
</div>
</div>
";
}
public function getTemplateName()
{
return "partials/program-social.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
$e->guess();
throw $e;
}
}
{
return $this;
}
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*/
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
// line 10
$this->loadTemplate([0 => "partials/featured-image.html.twig"], "single-event.html.twig", 10)->display($context);
// line 11
echo " </div>
<section class=\"grid justify-items-center md:justify-items-start\">
";
// line 13
$this->loadTemplate([0 => "partials/title.html.twig"], "single-event.html.twig", 13)->display($context);
// line 14
echo " </section>
<div class=\"grid justify-items-center md:justify-items-start\">
";
// line 16
$this->loadTemplate([0 => "partials/program-content.html.twig"], "single-event.html.twig", 16)->display($context);
// line 17
echo " </div>
<div class=\"grid grid-cols-2 border border-mista-mine border-solid rounded p-2\">
";
// line 19
$this->loadTemplate([0 => "partials/program-social.html.twig"], "single-event.html.twig", 19)->display($context);
// line 20
echo " </div>
<div class=\"grid border border-mista-mine border-solid rounded p-2\">
";
// line 22
$this->loadTemplate([0 => "partials/program-countdown.html.twig"], "single-event.html.twig", 22)->display($context);
// line 23
echo " </div>
</div>
<div class=\"grid grid-f gap-3 py-4 md:justify-self-start\">
<div class=\"grid grid-rows-3 gap-2 border border-mista-mine border-solid rounded p-2\">
";
// line 27
$this->loadTemplate([0 => "partials/program-datetime.html.twig"], "single-event.html.twig", 27)->display($context);
// line 28
echo " </div>
<div class=\"grid border border-mista-mine border-solid rounded p-2\">
";
// line 30
$this->loadTemplate([0 => "partials/program-upcoming.html.twig"], "single-event.html.twig", 30)->display($context);
if ($useBlocks && isset($blocks[$name])) {
$template = $blocks[$name][0];
$block = $blocks[$name][1];
} elseif (isset($this->blocks[$name])) {
$template = $this->blocks[$name][0];
$block = $this->blocks[$name][1];
} else {
$template = null;
$block = null;
}
// avoid RCEs when sandbox is enabled
if (null !== $template && !$template instanceof self) {
throw new \LogicException('A block must be a method on a \Twig\Template instance.');
}
if (null !== $template) {
try {
$template->$block($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($template->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
$e->guess();
throw $e;
}
} elseif (false !== $parent = $this->getParent($context)) {
$parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
}
protected function doDisplay(array $context, array $blocks = [])
{
// line 1
$this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "debugger", []), "startTimer", [0 => "render", 1 => "Rendering page"], "method");
// line 2
$this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "setLayout", [], "method");
// line 3
$this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "loadAtoms", [], "method");
// line 4
$context["segments"] = $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "segments", [], "method");
// line 6
ob_start(function () { return ''; });
// line 7
echo " ";
if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "hasContent", [], "method")) {
// line 8
echo " ";
$this->displayBlock('content', $context, $blocks);
// line 10
echo " ";
}
$context["content"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
// line 13
$context["offcanvas"] = null;
// line 14
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
// line 15
echo " ";
if (($this->getAttribute($context["segment"], "type", []) == "offcanvas")) {
// line 16
$context["offcanvas"] = $context["segment"];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
$e->guess();
throw $e;
}
}
{
return $this;
}
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*/
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
public function __construct(Environment $env)
{
parent::__construct($env);
$this->blocks = [
'page_head' => [$this, 'block_page_head'],
'page_footer' => [$this, 'block_page_footer'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "@nucleus/page.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$this->parent = $this->loadTemplate("@nucleus/page.html.twig", "partials/page.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 3
public function block_page_head($context, array $blocks = [])
{
// line 4
if (($context["page_head"] ?? null)) {
// line 5
echo " ";
echo ($context["page_head"] ?? null);
echo "
";
} else {
// line 7
echo " ";
$this->displayParentBlock("page_head", $context, $blocks);
echo "
";
}
}
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
$e->guess();
throw $e;
}
}
{
return $this;
}
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*/
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
$this->blocks = [
'content' => [$this, 'block_content'],
];
}
protected function doGetParent(array $context)
{
// line 1
return "partials/page.html.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
// line 2
$context["twigTemplate"] = "single-event.html.twig";
// line 3
$context["nexttime"] = call_user_func_array($this->env->getFunction('function')->getCallable(), ["eo_get_next_occurrence"]);
// line 1
$this->parent = $this->loadTemplate("partials/page.html.twig", "single-event.html.twig", 1);
$this->parent->display($context, array_merge($this->blocks, $blocks));
}
// line 5
public function block_content($context, array $blocks = [])
{
// line 6
echo "
<article class=\"grid grid-template-event-efm md:grid-template-event-ef gap-4 p-4\">
<div class=\"grid grid-e gap-3 py-4 md:justify-self-end max-w-full\">
<div class=\"grid justify-items-center md:justify-items-start\">
";
// line 10
$this->loadTemplate([0 => "partials/featured-image.html.twig"], "single-event.html.twig", 10)->display($context);
// line 11
echo " </div>
<section class=\"grid justify-items-center md:justify-items-start\">
";
// line 13
$this->loadTemplate([0 => "partials/title.html.twig"], "single-event.html.twig", 13)->display($context);
// line 14
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
$this->doDisplay($context, $blocks);
} catch (Error $e) {
if (!$e->getSourceContext()) {
$e->setSourceContext($this->getSourceContext());
}
// this is mostly useful for \Twig\Error\LoaderError exceptions
// see \Twig\Error\LoaderError
if (-1 === $e->getTemplateLine()) {
$e->guess();
}
throw $e;
} catch (\Exception $e) {
$e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
$e->guess();
throw $e;
}
}
{
return $this;
}
/**
* Returns all blocks.
*
* This method is for internal use only and should never be called
* directly.
*
* @return array An array of blocks
*/
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
public function getBlocks()
{
return $this->blocks;
}
public function display(array $context, array $blocks = [])
{
$this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
}
public function render(array $context)
{
$level = ob_get_level();
if ($this->env->isDebug()) {
ob_start();
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} catch (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
return ob_get_clean();
}
protected function displayWithErrorHandling(array $context, array $blocks = [])
{
try {
* @internal
*/
public function __construct(Environment $env, Template $template)
{
$this->env = $env;
$this->template = $template;
}
/**
* Renders the template.
*
* @param array $context An array of parameters to pass to the template
*
* @return string The rendered template
*/
public function render($context = [])
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []);
}
/**
* Displays the template.
*
* @param array $context An array of parameters to pass to the template
*/
public function display($context = [])
{
// using func_get_args() allows to not expose the blocks argument
// as it should only be used by internal code
$this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []);
}
/**
* Checks if a block is defined.
*
* @param string $name The block name
* @param array $context An array of parameters to pass to the template
*
$key = null;
$output = false;
if ( false !== $expires ) {
ksort($data);
$key = md5($file.json_encode($data));
$output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
}
if ( false === $output || null === $output ) {
$twig = $this->get_twig();
if ( strlen($file) ) {
$loader = $this->get_loader();
$result = $loader->getCacheKey($file);
do_action('timber_loader_render_file', $result);
}
$data = apply_filters('timber_loader_render_data', $data);
$data = apply_filters('timber/loader/render_data', $data, $file);
$template = $twig->load($file);
$output = $template->render($data);
}
if ( false !== $output && false !== $expires && null !== $key ) {
$this->delete_cache();
$this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
}
$output = apply_filters('timber_output', $output);
return apply_filters('timber/output', $output, $data, $file);
}
protected function delete_cache() {
Cleaner::delete_transients();
}
/**
* Get first existing template.
*
* @param array|string $templates Name(s) of the Twig template(s) to choose from.
* @return string|bool Name of chosen template, otherwise false.
*/
if ( $via_render ) {
$file = apply_filters('timber_render_file', $file);
} else {
$file = apply_filters('timber_compile_file', $file);
}
$output = false;
if ($file !== false) {
if ( is_null($data) ) {
$data = array();
}
if ( $via_render ) {
$data = apply_filters('timber_render_data', $data);
} else {
$data = apply_filters('timber_compile_data', $data);
}
$output = $loader->render($file, $data, $expires, $cache_mode);
} else {
if ( is_array($filenames) ) {
$filenames = implode(", ", $filenames);
}
Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
}
do_action('timber_compile_done');
return $output;
}
/**
* Compile a string.
*
* @api
* @example
* ```php
* $data = array(
* 'username' => 'Jane Doe',
* );
$twig = $dummy_loader->get_twig();
$template = $twig->createTemplate($string);
return $template->render($data);
}
/**
* Fetch function.
*
* @api
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* array, the first value is used for non-logged in visitors, the second for users.
* Default false.
* @param string $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
* @return bool|string The returned output.
*/
public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
$output = self::compile($filenames, $data, $expires, $cache_mode, true);
$output = apply_filters('timber_compile_result', $output);
return $output;
}
/**
* Render function.
*
* Passes data to a Twig file and echoes the output.
*
* @api
* @example
* ```php
* $context = Timber::context();
*
* Timber::render( 'index.twig', $context );
* ```
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* Passes data to a Twig file and echoes the output.
*
* @api
* @example
* ```php
* $context = Timber::context();
*
* Timber::render( 'index.twig', $context );
* ```
* @param array|string $filenames Name of the Twig file to render. If this is an array of files, Timber will
* render the first file that exists.
* @param array $data Optional. An array of data to use in Twig template.
* @param bool|int $expires Optional. In seconds. Use false to disable cache altogether. When passed an
* array, the first value is used for non-logged in visitors, the second for users.
* Default false.
* @param string $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
* @return bool|string The echoed output.
*/
public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
$output = self::fetch($filenames, $data, $expires, $cache_mode);
echo $output;
return $output;
}
/**
* Render a string with Twig variables.
*
* @api
* @example
* ```php
* $data = array(
* 'username' => 'Jane Doe',
* );
*
* Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
* ```
* @param string $string A string with Twig variables.
* @param array $data An array of data to use in Twig template.
* @return bool|string
*/
use Timber\Timber;
/*
* The Template for displaying all single posts
*/
$gantry = Gantry::instance();
/** @var Theme $theme */
$theme = $gantry['theme'];
// We need to render contents of <head> before plugin content gets added.
$context = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
$post = Timber::query_post();
$context['post'] = $post;
$context['wp_title'] .= ' - ' . $post->title();
Timber::render(['single-' . $post->ID . '.html.twig', 'single-' . $post->post_type . '.html.twig', 'single.html.twig'], $context);
}
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';