This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param string $url | |
* @param string $type | |
* @return string | |
*/ | |
function modify_month_list_link_urls( $url, $type ) { | |
if ( 'month' === $type ) return str_replace( 'month', 'calendar', $url ); | |
if ( 'list' === $type ) return str_replace( 'list', 'all-events', $url ); | |
if ( 'photo' === $type ) return str_replace( 'photo', 'picture-board', $url ); | |
return $url; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Allows visitors to page forward/backwards in any direction within month view | |
* an "infinite" number of times (ie, outwith the populated range of months). | |
*/ | |
class ContinualMonthViewPagination { | |
protected $tec; | |
public function __construct() { | |
add_filter( 'tribe_events_the_next_month_link', array( $this, 'next_month' ) ); | |
add_filter( 'tribe_events_the_previous_month_link', array( $this, 'previous_month' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to hide end time in list, map, photo, and single event view | |
// NOTE: This will only hide the end time for events that end on the same day | |
add_filter( 'tribe_events_event_schedule_details_formatting', 'remove_end_time', 10, 2); | |
function remove_end_time( $formatting_details ) { | |
$formatting_details['show_end_time'] = 0; | |
return $formatting_details; | |
} | |
// Function to hide end time in Week and Month View Tooltips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class EventsListWidget_NewlyAddedEvents { | |
protected $constraints = array( | |
'sidebar_id' => null, | |
'widget_id' => null, | |
'widget_title' => null | |
); | |
public function __construct( array $constraints = array() ) { | |
$this->constraints = array_merge( $this->constraints, $constraints ); | |
add_filter( 'widget_display_callback', array( $this, 'setup' ), 10, 3 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_widget_featured_image() { | |
global $post; | |
echo tribe_event_featured_image( $post->ID, 'thumbnail' ); | |
} | |
add_action( 'tribe_events_list_widget_before_the_event_title', 'custom_widget_featured_image' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( date_i18n( 'Y-m-01' ) !== tribe_get_month_view_date() ) : ?> | |
<li class="tribe-events-nav-current"> | |
<a href="<?php echo Tribe__Events__Main::instance()->getLink( 'month' ) ?>">Back to Current Month</a> | |
</li> | |
<?php endif ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Removes categories "meetup" and "shindig" from list and month views | |
*/ | |
function tribe_exclude_events_category( $wp_query ) { | |
// Slugs for the categories you wish to hide | |
$exclude_cats = array('meetup', 'shindig'); |