Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / tribe_remove_virtual_events_from_exports.php
Created Dec 7, 2020
Remove the Zoom Links from the Google Calendar and iCal Exports
View tribe_remove_virtual_events_from_exports.php
<?php
/**
* Remove the Zoom Links from the Google Calendar and iCal Exports
*
*/
function tribe_remove_virtual_events_from_exports() {
remove_filter( 'tribe_google_calendar_parameters', [ tribe( 'events-virtual.export' ), 'filter_google_calendar_parameters' ] );
remove_filter( 'tribe_ical_feed_item', [ tribe( 'events-virtual.export' ), 'filter_ical_feed_items' ] );
}
add_action( 'wp', 'tribe_remove_virtual_events_from_exports' );
@jesseeproductions
jesseeproductions / tribe_wo_server_deregister_files.php
Last active Dec 1, 2020
Disable WP-Oauth Select 2 Script on Single Tribe Events Editor
View tribe_wo_server_deregister_files.php
<?php
/**
* Disable WP-Oauth Select 2 Script on Single Tribe Events Editor
*
*/
function tribe_wo_server_deregister_files() {
if ( 'tribe_events' !== get_post_type() ) {
return;
}
wp_dequeue_script( 'wo_admin_select2' );
View tribe_show_latest_past_events.php
// Disables on All Views
add_filter('tribe_events_views_v2_show_latest_past_events_view', 'tribe_show_latest_past_events' );
// Disable for a Specific View ( replace month with list, day, map, photo, or week )
//add_filter('tribe_events_views_v2_month_show_latest_past_events_view', 'tribe_show_latest_past_events' );
/**
* Filter to Hide the Latest Past Events
*
* @return bool Return false to disable the Latest Past Events
*/
View tribe_show_latest_past_events.php
// Disables on All Views
add_filter('tribe_events_views_v2_show_latest_past_events_view', 'tribe_show_latest_past_events' );
// Disable for a Specific View ( replace month with list, day, map, photo, or week )
//add_filter('tribe_events_views_v2_month_show_latest_past_events_view', 'tribe_show_latest_past_events' );
/**
* Filter to Hide the Latest Past Events
*
* @return bool Return false to disable the Latest Past Events
*/
@jesseeproductions
jesseeproductions / tribe_set_link_to_website_v2.php
Created Feb 27, 2020
Modify the Event Permalink if there is a Website URL in The Events Calendar 5.0
View tribe_set_link_to_website_v2.php
@jesseeproductions
jesseeproductions / cctor_change_category_to_location.php
Created Feb 27, 2020
Change Categories to Location for Coupon Creator Pro Filter Bar
View cctor_change_category_to_location.php
/**
* Change Categories to Location for Coupon Creator Pro Filter Bar
*
* @param string $translation The translated text.
* @param string $text The text to translate.
* @param string $domain The domain slug of the translated text.
* @param string $context The option context string.
*
* @return string The translated text or the custom text.
*/
@jesseeproductions
jesseeproductions / tribe_exclude_from_search.php
Created Feb 26, 2020
Include only Posts and Pages in Search - Used with The Events Calendar 5.0 New Designs are Active
View tribe_exclude_from_search.php
/**
* Include only Posts and Pages in Search
* Used with The Events Calendar 5.0 New Designs are Active
*
* @param $query WP_Query
*
* @return mixed
*/
function exclude_from_search($query) {
@jesseeproductions
jesseeproductions / filter_categories_from_v2_views.php
Created Feb 19, 2020
Exclude Categories from The Events Calendar New Views
View filter_categories_from_v2_views.php
add_filter( 'tribe_events_views_v2_view_list_repository_args', 'filter_categories_from_v2_views', 20 );
add_filter( 'tribe_events_views_v2_view_month_repository_args', 'filter_categories_from_v2_views', 20 );
/**
* Exclude Categories from The Events Calendar New Views
* For TEC 5.0 and Greater
*
* @param array $repository_args An array of query variables.
*
* @return array An array of query variables.
*/
@jesseeproductions
jesseeproductions / tribe_change_available_msg.php
Created Feb 18, 2020
Change Are No Longer Available Message
View tribe_change_available_msg.php
/**
* Change Are No Longer Available Message
*
* @param string $translation The translated text.
* @param string $text The text to translate.
* @param string $domain The domain slug of the translated text.
* @param string $context The option context string.
*
* @return string The translated text or the custom text.
*/
@jesseeproductions
jesseeproductions / tribe_past_reverse_chronological_v2.php
Created Feb 12, 2020
Changes Past Event Reverse Chronological Order in New Views
View tribe_past_reverse_chronological_v2.php
/**
* Changes Past Event Reverse Chronological Order
*
* @param array $template_vars An array of variables used to display the current view.
*
* @return array Same as above.
*/
function tribe_past_reverse_chronological_v2( $template_vars ) {
if ( ! empty( $template_vars['is_past'] ) ) {