Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / eventbrite-iframe.php
Created January 31, 2017 10:51
Render EventBrite iFrame on event page when EventBrite event is set to private
<?php
/*
* For The Events Calendar and The Events Calendar: EventBrite Tickets
* Renders the EventBrite iFrame on single event page when EventBrite event is set to private
* Author: Barry Hughes
*/
function eb_iframe_show_even_if_private() {
$post_id = get_the_ID();
$api = tribe( 'eventbrite.api' );
@andrasguseo
andrasguseo / show-all-events-from-cat.php
Last active February 6, 2017 10:03
For Chad - show all events of a category, despite the ‘Hide From Event Listings’ being checked
<?php
$events = tribe_get_events(
array(
'eventDisplay' => 'list',
'posts_per_page' => 3,
'tax_query' => array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => $group_slug,
@andrasguseo
andrasguseo / multiday.php
Last active February 9, 2017 00:05
A Snippet for List View Multi Day Events Start Time - The Events Calendar
<?php
/*
Plugin Name: A Snippet for List View Multi Day Events Start Time - The Events Calendar
Plugin URI: http://theeventscalendar.com
Description: This plugin changes the List View Start Times for Multiple Day Events.
A long term that starts in the past shows up in the current month rather than appearing in its own month.
For example if an exhibition runs for a year from 1 April 2016 – 1 April 2017, it would currently mean
that the calendar would have a April 2016 section at the top which just looks like you have out of date info.
@andrasguseo
andrasguseo / ce-temp-timepicker-fix.php
Created February 20, 2017 15:21
Temporary fix for the Community Events timepicker format
<?php
/*
* Changes the formatting of the timepicker in The Events Calendar: Community Events submission form
* Change format in line 17 based on https://codex.wordpress.org/Formatting_Date_and_Time
*
* Author: Barry Hughes
*/
function ce_timepicker_24hr_fix() {
echo "
<script type='text/javascript'>
@andrasguseo
andrasguseo / hide-tinymce-editor.php
Last active March 8, 2017 23:05
Hide the TinyMCE editor
<?php
/* LOAD CUSTOM STYLES AT THE END OF THE PAGE */
function hide_tinymce() {
?>
<style type="text/css">
#postdivrich {
display: none;
}
</style>
@andrasguseo
andrasguseo / limit-photo-view-excerpt.php
Created March 13, 2017 22:39
Limit the number of words in the excerpt in Photo View
<?php
/*
* Limit the number of words in the excerpt in photo view
* For Events Calendar Pro
* Last update: March 13, 2017
* Last version checked: ECPro 4.4.4
* Author: Barry Hughes
*/
@andrasguseo
andrasguseo / missing-from.pot
Created April 28, 2017 00:16
TEC .pot files
"X-Poedit-Basepath: ..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
@andrasguseo
andrasguseo / default-view-with-first-event.php
Last active May 1, 2017 19:37
Set the view to the date with the first upcoming event
<?php
/*
* In month view the month with the first upcoming event is shown
* Author: Barry Hughes, Andras Guseo
* Last updated: February 17, 2017
*/
add_action( 'tribe_events_pre_get_posts', 'fast_forward_month_view' );
function fast_forward_month_view( $query ) {
// Don't interfere with other month views (like mini-cal)
@andrasguseo
andrasguseo / no-more-ticket-sales.php
Last active May 1, 2017 22:24
Print message if no tickets are available
<?php
/* If there are no tickets available for a future event, or the event is in the past,
* Then a message will be shown to the users on the single event page.
*
* For The Events Calendar and Event Tickets plugins by Modern Tribe
* Author: Andras Guseo
* Last updated: May 1, 2017
*/
add_action( 'tribe_events_single_event_after_the_meta', 'no_tix_message' );
@andrasguseo
andrasguseo / tribe_add_ical_to_email.php
Last active May 2, 2017 22:44
MT | ET | Add a + iCal link to each ticket in the tickets email
<?php
/**
* Adds a + iCal link to each ticket in the tickets email
*
* @see tribe_tickets_ticket_email_ticket_bottom
*/
function tribe_add_ical_to_email( $order ) {
// Temporarily change global post.
$original_post = $GLOBALS['post'];