Skip to content

Instantly share code, notes, and snippets.

@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() {
@GeoffEW
GeoffEW / prevent_export.php
Last active October 2, 2022 15:15
Prevent calendar export links from showing anywhere on the front-end.
<?php
/**
* Prevent calendar export links from showing anywhere on the front-end.
*
*
*/
class Tribe__Events__Remove__Export__Links {
public function __construct() {
add_action( 'init', array( $this, 'single_event_links' ) );
@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' );
@andrasguseo
andrasguseo / et-meta-hawk.php
Created November 30, 2016 15:44
Event Tickets Meta Hawk by Barry
<?php
/**
* Plugin name: Event Tickets Meta Hawk
* Description: Lets site administrators soar over attendee meta data supplied by attendees then swoop down, hawk-like, to change it. Proof of concept targeting the WooCommerce provider.
* Version: 2016-03-21
* Author: Barry Hughes
*
* Experiment in making attendee meta editable via the attendee screen.
* Well worth bearing in mind that:
*
@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 ) {
@GeoffEW
GeoffEW / remove_free.php
Created November 1, 2016 04:50
The Events Calendar - Make code empty if it's 0 or Free
<?php
/*
* The Events Calendar - Make code empty if it's 0 or Free
*/
add_filter ( 'tribe_get_cost', 'tribe_not_show_free', 10, 3 );
function tribe_not_show_free ( $cost, $post_id, $with_currency_symbol ) {
if ( $cost == 0 || $cost == 'Free' ) {
$cost = '';
@cliffordp
cliffordp / functions.php
Last active March 30, 2018 03:20
Set default quantity of 1 for all ET and ET+ tickets: RSVP, Woo, EDD
<?php
/**
* Set default quantity of 1 for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab
* Same as this snippet but also make the quantity readonly: https://gist.github.com/cliffordp/80b33455779b74ec49f6ea3033cb47bf
@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' );
@cliffordp
cliffordp / functions.php
Last active May 1, 2019 05:52
For https://theeventscalendar.com/support/forums/topic/number-of-tickets-available/ The Events Calendar + Event Tickets Plus + WooCommerce: Hide remaining quantity unless it is less than 4 (to create a sense of urgency) NOTE: Would need .each loop logic to work properly for more than just the first WooCommerce ticket if more than 1 WooCommerce t…
<?php
/**
* The Events Calendar + Event Tickets Plus + WooCommerce: Hide remaining
* quantity unless it is less than 4 (to create a sense of urgency).
*
* NOTE: We would need .each loop logic to work properly for more than just the
* first WooCommerce ticket if more than 1 WooCommerce ticket is available
* per event!
*
* If you want to ALWAYS hide (no sense of urgency logic), do not use this
@andrasguseo
andrasguseo / functions.php
Last active April 24, 2020 16:42
Hide the quantity field on the WooCommerce cart page
<?php
/*
* For the following plugins:
* The Events Calendar, Event Tickets, Event Tickets Plus, WooCommerce
*
* The function hides the quantity form field from the cart page
* so users cannot change the product / ticket quantity there.
* It shows the number as plain text.
* Note: it only allows you to put 1 of all products in the cart!!!
* Useful if you are collecting attendee information with Event Tickets Plus