Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
GeoffEW / gist:223fca6f45b78f2d1a42
Last active March 4, 2016 03:43
Removing extra comment block
.single-tribe_events #comments-block {display:none !important;}
.single-tribe_events #tribe-events-content #comments-block {display:block !important;}
@GeoffEW
GeoffEW / gist:88f728c6b6e0742aa29a
Created February 24, 2016 02:53
Smaller single image
.single-tribe_events .tribe-events-event-image img {max-width: 50%;}
.quantity input::-webkit-outer-spin-button, .quantity input::-webkit-inner-spin-button {
-webkit-appearance: inner-spin-button !important;
}
.quantity .input-text.qty {
width: 61px;
height: 62px;
padding: 0 5px;
text-align: center;
}
@GeoffEW
GeoffEW / Ticket_Salest.txt
Last active March 9, 2016 19:34
Page template for ticket sales report
<?php
global $wpdb;
$results = $wpdb->get_results("SELECT p.post_title as product, pm.meta_value as total_sales FROM wp_posts AS p LEFT JOIN wp_postmeta AS pm ON (p.ID = pm.post_id AND pm.meta_key LIKE 'total_sales') WHERE p.post_type LIKE 'product' AND p.post_status LIKE 'publish'", 'ARRAY_A');
?>
<table>
<?php
foreach ( $results as $result ) { ?>
<tr>
<td style="padding: 20px 10px 10px;">
<p><?php echo $result['product']; ?> -</p>
@GeoffEW
GeoffEW / Revslider-slash-url-fix.php
Last active March 28, 2016 22:59
Fixes 404 message when events are displayed through Rev Slider and contain a "-" in the URL
<?php
/* to be placed in /wp-content/plugins/revslider/includes/slide.class.php */
if(isset($this->params['enable_link']) && $this->params['enable_link'] == “true” && isset($this->params['link_type']) && $this->params[‘link_type’] == “regular”){
/* The original code is this line */
$link = RevSliderFunctions::getVal($this->postData, 'link');
/* Fixed by JRB for tribe Event url containing dash */
$link = esc_url( get_permalink( $this->id ) );
$this->params[“link”] = str_replace(array(“%link%”, '{{link}}'), $link, $this->params[“link”]);
@GeoffEW
GeoffEW / Restore_ticket_csv_export.php
Last active May 4, 2022 10:11
Restores meta field and ticket # in CSV export for ET+ and ET
<?php
function restore_ticket_csv_headers( $columns ) {
// Only meddle with the attendee csv export request
if ( ! isset( $_GET['attendees_csv'] ) ) return $columns;
// Tribe__Tickets__Tickets_Handler::instance() already owns an attendee
// table object but it is private and there is not currently an accessor
$attendees_table = new Tribe__Tickets__Attendees_Table();
@GeoffEW
GeoffEW / enfold_attendee.php
Created June 6, 2016 16:07
Adds compatibility with Enfold for Attendee meta information
<?php
function add_custom_script(){
?>
<script>
(function($){
$(window).load(function() {
$('.quantity').on('click', 'input[type="button"]', function(){
$('.quantity input[type="text"]').trigger('keyup');
});
@GeoffEW
GeoffEW / eventbrite-fluid-iframe.php
Created June 10, 2016 06:20
Changes made around line 72 of /the-events-calendar-eventbrite-tickets/src/Tribe/Template.php to add a Fluidmedia class
<?php
<div class="eventbrite-ticket-embed fluidMedia" style="width: 100%%; text-align: left;"><iframe id="eventbrite-tickets-%1$s" style="width: 100%%; overflow: auto;" src="%2$s" width="300" height="150"></iframe></div>
<div style="font-family: Helvetica, Arial; font-size: 10px; padding: 5px 0 5px; margin: 2px; width: 100%%; text-align: left;"><a style="color: #ddd; text-decoration: none;" href="http://www.eventbrite.com/features?ref=etckt" target="_blank">Event registration</a>
@GeoffEW
GeoffEW / tempfix_62004.php
Created June 15, 2016 16:47
Updates _eventCost after updating price in WooCommerce
<?php
/**
* If a (ticket) product is updated via the WooCommerce product editor
* or even via quick edits then attempt to keep the cost fields in sync.
*
* @param int $product_id
*/
function tempfix_62004_sync_ticket_price( $product_id ) {
if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) return;
if ( ! tribe_events_product_is_ticket( $product_id ) ) return;
@GeoffEW
GeoffEW / fix-oembed.php
Created June 27, 2016 22:38
Fix oEmbed Pro 4.2+
<?php
/**
* Avoid a problem with Events Calendar PRO 4.2 which can inadvertently
* break oembeds.
*/
function undo_recurrence_oembed_logic() {
if ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) return;
$pro_object = Tribe__Events__Pro__Main::instance();
$pro_callback = array( $pro_object, 'oembed_request_post_id_for_recurring_events' );