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
This line is indented with an initial tab. | |
This line is not indented. |
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 | |
/** | |
* Supports accessing and importing events upto 2yrs in the future when using | |
* the "Other URL" import feature. | |
* | |
* Note that the source site may have a cap on the number of events it will | |
* "yield". The "tribe_rest_event_max_per_page" filter hook can be used there | |
* to increase that, if it is a site under your own control. | |
*/ |
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 | |
/** | |
* Alter list view queries to be accurate to the minute (vs accurate to the second) | |
* to give additional opportunities for persistent caching to kick in. | |
*/ | |
add_action( 'tribe_events_pre_get_posts', function( $event_query ) { | |
// Only modify event list queries | |
if ( 'list' !== $event_query->get( 'eventDisplay') ) { | |
return; | |
} |
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 | |
/** | |
* Enable support for multiple venues. | |
*/ | |
add_filter( 'tribe_events_linked_post_type_args', function( $args ) { | |
$args['allow_multiple'] = true; | |
return $args; | |
}, 100 ); |
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 | |
/** | |
* Require that a new or existing venue is specified when events are submitted via | |
* the frontend submission form provided by Community Events. | |
* | |
* This is a temporary workaround for bug #76297. | |
*/ | |
function ce_submissions_require_venue( array $submission ) { | |
// Unhook self |
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 | |
$mini_cal_event_atts = tribe_events_get_widget_event_atts(); | |
$post_date = tribe_events_get_widget_event_post_date(); | |
$post_id = get_the_ID(); | |
$organizer_ids = tribe_get_organizer_ids(); | |
$multiple_organizers = count( $organizer_ids ) > 1; | |
$city_name = ! empty( $city ) ? tribe_get_region() : ''; |
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 | |
function post_to_bbp_shortcode() { | |
if ( 'success' === post_to_bbp_status() ) { | |
return post_to_bbp_success(); | |
} | |
else { | |
return post_to_bbp_form(); | |
} | |
} |
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 | |
/** | |
* Updates instances of the Countdown Widget so that they always | |
* point to an event which has not yet started. | |
* | |
* This works by intercepting events before the widget is rendered: | |
* if it looks like the event the widget is targeting has already | |
* started, the object will select the next upcoming event (if one | |
* is available) and set the widget to use that instead. | |
* |
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
-- Quickly delete all events, organizers and venues | |
-- and their associated post meta data | |
-- | |
-- (The Events Calendar 4.x) | |
DELETE wp_posts, wp_postmeta FROM wp_posts | |
INNER JOIN wp_postmeta ON wp_postmeta.post_id = wp_posts.ID | |
WHERE wp_posts.post_type IN ( | |
'tribe_events', | |
'tribe_organizer', | |
'tribe_venue' |
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 | |
/** | |
* Takes a plain text file and transforms it into a PHP array representation. | |
* | |
* Paragraphs are understood to be seperated by blank lines (so if the source | |
* text exclusively uses a different convention, such as the opening line of | |
* each paragraph being tabbed in, this won't work without adjustment). | |
* | |
* Example source: | |
* |