Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
geoffgraham / events-in-loop.php
Created December 5, 2016 23:55
The Events Calendar // Add Events to Main Blog Loop, with Custom Parameters
function my_custom_event_order( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'post_type','tribe_events');
$query->set( 'orderby','date');
$query->set( 'order','DESC');
return $query;
}
}
add_action( 'pre_get_posts', 'my_custom_event_order' );
@geoffgraham
geoffgraham / reverse-alphabet-order.php
Last active December 19, 2016 21:11
The Events Calendar 4.2.6 // Display Upcoming Events in Descending Alphabetical Order
add_action( 'pre_get_posts', 'tribe_post_alphabetical_ordering', 51 );
function tribe_post_alphabetical_ordering( $query ) {
if( tribe_is_upcoming() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
@GeoffEW
GeoffEW / prevent_email.php
Created September 29, 2016 03:47
tribe__prevent_woo_tickets_email_to_be_sent
<?php
/* Tribe, prevent woo tickets email to be sent */
add_filter( 'wootickets-tickets-email-enabled', '__return_false' );
@GeoffEW
GeoffEW / past_events.php
Created October 18, 2016 21:58
Adds past event possibilities to the tribe_events shortcode
<?php function tribe_past_events_shortcode( $atts ) {
if ( ! class_exists( 'Tribe__Events__Pro__Shortcodes__Tribe_Events' ) ) return '';
add_action( 'parse_query', 'tribe_past_events_shortcode_modify_query' );
$shortcode = new Tribe__Events__Pro__Shortcodes__Tribe_Events( $atts );
return $shortcode->output();
}
function tribe_past_events_shortcode_modify_query( $query ) {
$query->set( 'tribe_is_past', true );
remove_action( 'parse_query', 'tribe_past_events_shortcode_modify_query' );
<?php
/**
* Event Submission Form Ticket Block
* Renders the ticket settings in the submission form.
*
* Override this template in your own theme by creating a file at
* [your-theme]/tribe-events/community-tickets/modules/tickets.php
*
* @version 4.1
* @package Tribe__Events__Community__Tickets__Main
@ni-le
ni-le / string_changing_extensions.php
Last active February 17, 2017 21:57
The Events Calendar extended string changer
<?php
/* Additional functions for changing strings in the events calendar and its plugins
* See https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/ for details
* on the provided functions by the TEC team
* 1. - function for changing quantity based spelling
* 2. - function for changing strings with an attached context
*/
function tribe_custom_theme_numbered_text ( $translation, $single, $plural, $number, $domain ) {
@cliffordp
cliffordp / functions.php
Last active February 27, 2017 18:53
Event Tickets: Move the Tickets View ("You have X RSVPs and X tickets for this Event. View your RSVPs and Tickets") to a different location on the Event Single page * Event Tickets Plus: Move the Attendees List ("Who's Attending") to a different location on the Event Single page
<?php
/**
* Event Tickets: Move the Tickets View ("You have X RSVPs and X tickets for this Event. View your RSVPs and Tickets") to a different location on the Event Single page
* Event Tickets Plus: Move the Attendees List ("Who's Attending") to a different location on the Event Single page
* From https://gist.github.com/cliffordp/f95b520a71635fd4e9d73eb2af73bd5e
**/
add_action( 'init', 'cliff_et_move_tickets_view_and_attendees_list' );
function cliff_et_move_tickets_view_and_attendees_list() {
@elimn
elimn / tribe_body_class_recurring_all.php
Created March 1, 2017 08:46
MT | ECP | Add a recurring all body class to the recurring all page
<?php
if ( ! function_exists( 'tribe_body_class_recurring_all' ) ) {
/**
* Adds a recurring all body class to the recurring all page
*
* @see body_class
*/
function tribe_body_class_recurring_all( $classes, $class ) {
@GeoffEW
GeoffEW / change_rsvp_label_CT.php
Created August 10, 2016 21:29
Replaces label for RSVP tickets in the radio button selector in the Community Tickets front-end "Add ticket" interface
<?php
function change_rsvp_label() { ?>
<script>
jQuery(document).ready( function ( ){
jQuery('input[value="Tribe__Tickets__RSVP"]').next().html('Free Tickets');
@barryhughes
barryhughes / remove-payment-options-link.php
Last active April 12, 2017 21:56
Remove payment options link from frontend