Skip to content

Instantly share code, notes, and snippets.

@jesseeproductions
jesseeproductions / ecp-cf-3-9
Last active February 16, 2024 07:00
The Events Calendar Custom Fields and Capabilties@3.9
The Events Calendar Custom Fields @3.9
Event Custom Post Type ( tribe_events )
_EventAllDay
_EventStartDate
_EventEndDate
_EventDuration
_EventVenueID
_EventShowMapLink
_EventShowMap
@jesseeproductions
jesseeproductions / tec-conditionals
Last active October 13, 2023 14:22
The Events Calendar Conditionals
/*-----------------------------------------------------------------------------------*/
/* The Events Calendar - Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if ( tribe_is_month() && ! is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page
@jesseeproductions
jesseeproductions / tribe_past_reverse_chronological_v2.php
Created February 12, 2020 16:53
Changes Past Event Reverse Chronological Order in New Views
/**
* 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'] ) ) {
@jesseeproductions
jesseeproductions / tec-mon-redirect
Created May 21, 2015 17:53
The Events Calendar - Redirect Mobile Users to List View
/*
* The Events Calendar - Redirect Mobile Users to List View
* @version 3.9
*
* @link http://theeventscalendar.com/support/forums/topic/forcing-list-view-on-mobile-only/
*/
add_action( 'template_redirect', 'tec_mobile_template_redirect' );
function tec_mobile_template_redirect() {
if( tribe_is_month() && wp_is_mobile() ) {
wp_redirect( tribe_get_listview_link() );
@jesseeproductions
jesseeproductions / tickets-plus-disable-tax.php
Created March 2, 2016 13:51
Event Tickets Plus - Disable Taxes for Ticket Products
/**
* Event Tickets Plus - Disable Taxes for Ticket Products
*/
add_action( 'wootickets_after_save_ticket', 'tribe_disable_taxes_ticket_product' );
function tribe_disable_taxes_ticket_product( $ticket_id ) {
update_post_meta( $ticket_id, '_tax_status', 'none' );
update_post_meta( $ticket_id, '_tax_class', 'zero-rate' );
}
@jesseeproductions
jesseeproductions / woo-tix-3-9-change-order-text
Created April 30, 2015 15:46
WooCommerce Tickets change "You’ll receive your tickets in another email." text
/*
* WooCommerce Tickets change "You’ll receive your tickets in another email." text
* @version 3.9
*
*/
add_filter('wootickets_email_message', 'woo_tickets_filter_completed_order', 10 );
function woo_tickets_filter_completed_order($text) {
$text = "New Text Here";
@jesseeproductions
jesseeproductions / tribe_remove_virtual_events_from_exports.php
Created December 7, 2020 18:24
Remove the Zoom Links from the Google Calendar and iCal Exports
<?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 December 1, 2020 19:13
Disable WP-Oauth Select 2 Script on Single Tribe Events Editor
<?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' );
@jesseeproductions
jesseeproductions / remove-categories-not-replated.php
Last active June 30, 2020 15:07
Removes categories "tech" from list and month views
/*
* The Events Calendar Remove Events from Month and List Views
* add coding to theme's functions.php
* @version 3.12
* modify here with event category slugs: array( 'concert', 'convention' )
*/
add_action( 'pre_get_posts', 'tribe_exclude_events_category_month_list' );
function tribe_exclude_events_category_month_list( $query ) {
if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) {
@jesseeproductions
jesseeproductions / ecp-ajax-off
Last active June 19, 2020 10:41
Remove Ajax from The Events Calendar Pagination on Month, List, and Day Views
/*
* Remove Ajax from The Events Calendar Pagination on Month, List, and Day Views
* @4.0.6
*
*/
function events_calendar_remove_scripts() {
if (!is_admin() && !in_array( $GLOBALS['pagenow'], array( 'wp-login.php', 'wp-register.php' ) ) ) {
wp_dequeue_script( 'the-events-calendar');
wp_dequeue_script( 'tribe-events-list');