This file contains hidden or 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 | |
/** | |
* Tries to force the minicalendar widget to show the month of the next upcoming event by default, rather | |
* than simply showing the current month (which might be empty). | |
*/ | |
class Tribe_Advance_Minical | |
{ | |
protected $target_date = false; |
This file contains hidden or 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 | |
add_filter('tribe_get_events_title', 'change_upcoming_events_title'); | |
function change_upcoming_events_title($title) { | |
//We'll change the title on upcoming and map views | |
if (tribe_is_upcoming() or tribe_is_map() or tribe_is_photo()) return 'Upcoming Parties'; | |
//In all other circumstances, leave the original title in place | |
return $title; |
This file contains hidden or 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 | |
// Overrides every request for viewOption from TribeEvents::getOption() | |
function tribe_swap_default_category_view ($option, $default, $optionName) { | |
// For a list of acceptable views/values run print_r(tribe_events_enabled_views()); | |
$default_events_view = 'month'; // The default view for the main page, venue, etc. | |
$default_category_view = 'list'; // The default view for any calendar category |
This file contains hidden or 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 | |
// Prepends category name(s) to the event titles | |
function tribe_events_title_include_cat ($title, $id) { | |
$separator = ' » '; // HTML Separator between categories and title | |
$cats = get_the_terms($id, 'tribe_events_cat'); | |
$is_ajax = defined('DOING_AJAX') && DOING_AJAX; | |
$is_truly_admin = is_admin() && !$is_ajax; |
This file contains hidden or 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 | |
// Changes all events to display as all day events | |
function tribe_all_events_all_day ($output) { | |
if ( !is_admin() && tribe_is_event() ) { | |
$output = true; | |
} | |
return $output; |
This file contains hidden or 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 | |
// Selectively hide events from specific user roles | |
function tribe_event_category_permissions ($wp_query) { | |
// Include all posts on admin views | |
if ( is_admin() ) return $wp_query; | |
$exclude_cats = array(); |
This file contains hidden or 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 | |
// Allows "SQL_BIG_SELECTS", improving database performance on some MySQL configurations | |
function tribe_allow_large_joins(){ | |
global $wpdb; | |
$wpdb->query('SET SQL_BIG_SELECTS=1'); | |
} | |
add_action('init', 'tribe_allow_large_joins'); |
This file contains hidden or 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 | |
// Adds upcoming menu item to WP Admin Menu | |
function tribe_custom_admin_menu () { | |
add_submenu_page( | |
'/edit.php?post_type='.TribeEvents::POSTTYPE, | |
'Events: Upcoming', | |
'Events: Upcoming', | |
apply_filters( 'tribe_settings_req_cap', 'manage_options' ), | |
'edit.php?post_type='.TribeEvents::POSTTYPE.'&orderby=start-date&order=asc&upcoming-events=true' |
This file contains hidden or 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 | |
// Changes past event views to reverse chronological order | |
function tribe_past_reverse_chronological ($post_object) { | |
$past_ajax = (defined( 'DOING_AJAX' ) && DOING_AJAX && $_REQUEST['tribe_event_display'] === 'past') ? true : false; | |
if(tribe_is_past() || $past_ajax) { | |
$post_object = array_reverse($post_object); | |
} |
This file contains hidden or 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 | |
/* | |
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR | |
* See the codex to learn more about WP text domains: | |
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology | |
* Example Tribe domains: 'tribe-events-calendar', 'tribe-events-calendar-pro'... | |
*/ | |
function tribe_custom_theme_text ( $translations, $text, $domain ) { | |
OlderNewer