Skip to content

Instantly share code, notes, and snippets.

Barry Hughes barryhughes

Block or report user

Report or block barryhughes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@barryhughes
barryhughes / category-links-below-event-search-bar.php
Created Nov 16, 2018
Adds a list of clickable category links below the main event search bar (sometimes referred to as the "Tribe Bar"). Tested with TEC 4.6.26.
View category-links-below-event-search-bar.php
@barryhughes
barryhughes / custom-event-category-templates.php
Created Oct 25, 2018
An example of using a different theme template for different event categories.
View custom-event-category-templates.php
<?php
/**
* Use custom templates for event views when specific categories
* have been requested.
*/
class Event_Category_Templates {
/**
* This will be true if an event view has been requested.
*
* @var bool
View force-use-of-qr-security-code.php
<?php
add_filter('tribe_tickets_plus_qr_check_security_code', '__return_true' );
View generate-eventbrite-testing-data-v3api.php
<?php
# Quickly generate a set of test events on Eventbrite.com
# (from within a WordPress environment - useful for setting
# up test scenarios etc).
$token = '--YOUR-TOKEN-HERE--';
$date = date_create( '2019-01-01 12:00:00' );
for ( $i = 0; $i <= 60; $i++ ) {
$date->modify( '+2 days' );
@barryhughes
barryhughes / override-min-max-coords.php
Created Aug 8, 2018
Sample of overriding the min/max map view coords (ECP 4.4.30)
View override-min-max-coords.php
<?php
# Prohibit caching of geoloc center point/bounds
add_filter( 'pre_transient_geoloc_center_point_estimation', '__return_null' );
# Override the min/max coords
add_filter( 'tribe_geoloc_pre_get_min_max_coords', function() {
return [
'min_lat' => 30,
'max_lat' => 40,
'min_lng' => 20,
@barryhughes
barryhughes / modifiy-multiday-event-tooltips.php
Created Aug 7, 2018
Alter the date presented within month view tooltips for multiday events.
View modifiy-multiday-event-tooltips.php
<?php
/**
* Modifies the month view tooltip for multiday events.
*
* Instead of seeing "5 - 15 August", the tooltip for multiday event will show
* the date of the cell which contains it.
*
* For example, if a visitor hovers over the multiday event name within the cell
* for 11 August, the tooltip will now display "11 August" etc.
*/
View gigpress-sample-export.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 23 columns, instead of 16. in line 3.
Date,Time,End date,Artist,Artist URL,Venue,Address,City,State,Postal code,Country,Venue phone,Venue URL,Admittance,Price,Ticket URL,Ticket phone,External URL,Notes,Tour,Status,Related ID,Related URL
2018-10-02,12:00:00,2018-10-05,Jon Bon Jovi,https://www.bonjovi.com/,Party Spot NW,1041 SW Marine Dr,Vancouver,BC,V6P 6L6,CA,,,Not sure,,,,,,,active,0,
2018-08-25,14:00:00,,The Spice Girls,http://thespicegirls.com/,Lakeway Dance Hall,714 Lakeway Dr,Bellingham,WA,98229,US,456-789-0123,http://lakeway.site.web,All Ages/Licensed,"¥2,225.00",,01222 333444,,"A rare treat with beef ribs jowl officia corned beef ad. Sed in culpa dolore irure corned beef shoulder nostrud cupidatat swine.
Dolore ullamco minim short loin short ribs cillum. Beef ham short loin strip steak in. Laboris biltong do filet mignon veniam drumstick.",,active,0,
2018-07-17,07:30:00,,Anna Carina,http://www.annacarina.net/,Chalkpit at Cedar City,1575 W 200 N,Cedar City,UT,84720,US,(1) 234 567 8901,,All Ages/Licensed,$25,http://some.tickets/getem/j
@barryhughes
barryhughes / remove-rsvp-ticket-form.php
Last active May 18, 2018
Remove RSVP ticket form from single events/posts, via code that can be added to a theme's functions.php file (where that's appropriate)
View remove-rsvp-ticket-form.php
<?php
// This code can be added to a theme's functions.php file to remove
// the frontend ticket form (RSVPs only)
if ( function_exists( 'tribe' ) && class_exists( 'Tribe__Tickets__RSVP' ) ) {
// Remove the RSVP ticket form from blog posts, etc
remove_filter( 'the_content', array(
tribe( 'tickets.rsvp' ), 'front_end_tickets_form_in_content'
), 11 );
// Remove the RSVP ticket form from single event posts
@barryhughes
barryhughes / experimental-smart-month-search.php
Created May 17, 2018
Improve month view search so it is not restricted to the current month. Experimental! Use at own risk, there are known bugs/quirks with this code.
View experimental-smart-month-search.php
<?php
/**
* If a search is conducted in month view but the relevant events
* are in a different month, switch to that month.
*
* Experimental! Especially during live ajax navigation, there are
* parts of this that don't work cleanly (pushstate/URL changes).
* Unsupported, use at own risk.
*/
class Transmogrified_Month_View_Search {
@barryhughes
barryhughes / add-post-date-column-to-events-wp-list-table.php
Created May 4, 2018
Add post date column to the events WP List Table (TEC 4.x)
View add-post-date-column-to-events-wp-list-table.php
<?php
function events_post_date_column( $column_id, $post_id ) {
echo 'post_date' === $column_id ? get_the_date( '', $post_id ) : '';
}
function events_post_date_column_header( $headers ) {
$headers['post_date'] = 'Post Date';
return $headers;
}
You can’t perform that action at this time.