This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin name: ET Meta Hawk | |
* Description: Lets site administrators soar over meta data supplied by attendees then swoop down, hawk-like, to change it. Proof of concept targeting the WooCommerce provider. | |
* Version: 2016-03-21 | |
* | |
* Experiment in making attendee meta editable via the attendee screen. | |
* Well worth bearing in mind that: | |
* | |
* - It currently won't work for RSVP or providers besides WooCommerce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function change_rsvp_label() { ?> | |
<script> | |
jQuery(document).ready( function ( ){ | |
jQuery('input[value="Tribe__Tickets__RSVP"]').next().html('Free Tickets'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Causes calendar to always show Google Map and Link, regardless of individual event settings | |
*/ | |
add_filter( 'tribe_embed_google_map', '__return_true' ); | |
add_filter( 'tribe_show_google_map_link', '__return_true' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Recurring events in wp-admin: only display first (parent) occurrence in list of Events | |
* (i.e. hide child recurring events) | |
* | |
* From https://theeventscalendar.com/knowledgebase/hide-recurring-event-instances-in-admin/ | |
* - https://gist.github.com/cliffordp/81f23a207ab483c9e7c6d910f9b29c0a | |
* 2016-07-04 Barry shared this snippet from a previous customer's own/shared customization | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customized version of the Time of Day filter that allows selecting by specific hour ranges in the afternoon | |
* New filter available in WP-Admin > Events > Settings > Filters | |
*/ | |
if ( class_exists( 'Tribe__Events__Filterbar__Filter' ) ) { | |
class Tribe__Events__Filterbar__Filters__Time_Of_Day_Custom extends Tribe__Events__Filterbar__Filter { | |
public $type = 'checkbox'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Prevents users from adding tickets to cart unless they have selected at least one ticket | |
*/ | |
function tribe_prevent_add_cart_empty() { | |
echo ' | |
<script type="text/javascript"> | |
jQuery( document ).ready(function(){ | |
jQuery( "form.cart" ).each(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Event Tickets Plus - Disable Taxes for Ticket Products | |
*/ | |
add_action( 'wootickets_after_save_ticket', 'tribe_disable_taxes_ticket_product' ); | |
function tribe_disable_taxes_ticket_product( $ticket_id ) { | |
update_post_meta( $ticket_id, '_tax_status', 'none' ); | |
update_post_meta( $ticket_id, '_tax_class', 'zero-rate' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* In month view, display all-day events below non-all-day events in each individual day cell. | |
* | |
* Barry wrote it 2016-02-15 | |
* https://gist.github.com/cliffordp/fc9b2df3c4d7cf062fde | |
* | |
* See https://gist.github.com/cliffordp/4a273f419457d8862bb0 for similar customization but for recurring events | |
* | |
* Uses two PHP anonymous functions so only compatible with PHP 5.3+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Events Tickets Plus - WooCommerce Tickets - Prevent Ticket Email from being sent. | |
* @ Version 4.0 | |
*/ | |
add_action( 'init', 'wootickets_stop_sending_email' ); | |
function wootickets_stop_sending_email() { | |
if ( class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) { | |
$woo = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance(); | |
remove_filter( 'woocommerce_email_classes', array( $woo, 'add_email_class_to_woocommerce' ) ); | |
add_action( 'woocommerce_email_after_order_table', array( $woo, 'add_tickets_msg_to_email' ) ); |