Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
GeoffEW / remove_recurrence_option.php
Created May 12, 2017
Tribe, remove recurrence from new event and edit event screens
View remove_recurrence_option.php
<?php
/* Tribe, remove recurrence from new event and edit event screens */
function tribe_remove_recurrence ( ) {
remove_action( 'tribe_events_date_display', array( 'Tribe__Events__Pro__Recurrence__Meta', 'loadRecurrenceData' ) );
}
add_action( 'admin_init', 'tribe_remove_recurrence' );
@GeoffEW
GeoffEW / change_ticket_in_email.php
Last active Oct 19, 2020
change_ticket_in_email.php
View change_ticket_in_email.php
<?php
function tribe_custom_theme_text ( $translation, $text, $domain ) {
// Put your custom text here in a key => value pair
// Example: 'Text you want to change' => 'This is what it will be changed to'
// The text you want to change is the key, and it is case-sensitive
// The text you want to change it to is the value
// You can freely add or remove key => values, but make sure to separate them with a comma
// This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
$custom_text = array(
View limit_tckt_qty.php
<?php
/* Tribe, limit ticket qty */
function tribe_limit_tickets() {
?>
<script type="text/javascript">
jQuery(document).ready( function( $ ) {
// do this if tickets available
if ( $('.tribe-events-tickets').length ) {
// set max qty to 1
@GeoffEW
GeoffEW / prevent_export.php
Last active Jun 4, 2020
Prevent calendar export links from showing anywhere on the front-end.
View prevent_export.php
<?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' ) );
@GeoffEW
GeoffEW / rsvp_control_strings.php
Last active May 7, 2020
RSVP control of strings
View rsvp_control_strings.php
<?php
function tribe_custom_theme_text ( $translation, $text, $domain ) {
$custom_text = array(
'Confirm RSVP' => 'Confirm Reservation',
'RSVP' => 'Reservation',
'Please fill in the RSVP confirmation name and email fields.' => 'Please fill in the Reservation confirmation name and email fields.',
'Send RSVP confirmation to:' => 'Send Reservation confirmation to:'
);
@GeoffEW
GeoffEW / attendees-list.php
Last active Feb 24, 2020
* Renders the attendee list for an event and all the attendee information
View attendees-list.php
<?php
/**
* Renders the attendee list for an event
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/attendees-list.php
*
* @version 4.3.5b
*
@GeoffEW
GeoffEW / tickettoproducts.php
Created Oct 3, 2016
Enable tickets to added to products
View tickettoproducts.php
<?php
/* Tribe, allow products to be an option to add ticket to in 'Events > Tickets > Settings' */
/* WARNING: this brought issues to customers in the past, so activate at your own risk */
if ( class_exists('Tribe__Tickets_Plus__Commerce__WooCommerce__Main') ) {
remove_filter( 'tribe_tickets_settings_post_types', array( Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(), 'exclude_product_post_type' ) );
}
@GeoffEW
GeoffEW / remove_free.php
Created Nov 1, 2016
The Events Calendar - Make code empty if it's 0 or Free
View remove_free.php
<?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 = '';
@GeoffEW
GeoffEW / force_cost.php
Created Jul 27, 2016
/* Force the use of the cost field of event and ignore tickets price */
View force_cost.php
<?php
/* Force the use of the cost field of event and ignore tickets price */
function tribe_just_show_price_field ( $cost, $post_id, $with_currency_symbol ) {
$cost_utils = Tribe__Events__Cost_Utils::instance();
$cost = tribe_get_event_meta( $post_id, '_EventCost' );
if ( $with_currency_symbol ) {
$cost = $cost_utils->maybe_format_with_currency( $cost );
@GeoffEW
GeoffEW / fix_for_blurry_phot_view.php
Created Jan 22, 2019
Fix for blurry images in the Photo view
View fix_for_blurry_phot_view.php
<?php
// Fix blurry photo image #jrfm
// To use in functions.php without the PHP opening tag at the top :-)
function tribe_adjust_photo_view_image_size($unfiltered) {
if ( tribe_is_photo() ) {
$filtered = get_the_post_thumbnail( get_the_ID(), 'full' );