Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin name: The Events Calendar: List Venues/Organizers Shortcodes
* Description: Adds shortcodes to help list venues and organizers. More info at http://m.tri.be/194s
* Author: Modern Tribe, Inc
* Author URI: http://theeventscalendar.com
* Version: 1.1
* License: GPL v3 - see http://www.gnu.org/licenses/gpl.html
*
* The Events Calendar: Venue/Organizer Shortcodes
@jentheo
jentheo / tooltip.php
Created January 17, 2018 19:29
Make tooltip clickable in month view
<?php
/**
* Please see single-event.php in this directory for detailed instructions on how to use and modify these templates.
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/month/tooltip.php
* @version 4.4
*/
?>
@jentheo
jentheo / edit-event.php
Created January 19, 2018 00:40
Add disclaimer to community events submission form
<?php
/**
* Event Submission Form
* The wrapper template for the event submission form.
*
* Override this template in your own theme by creating a file at
* [your-theme]/tribe-events/community/edit-event.php
*
* @since 3.1
* @version 4.5
@jentheo
jentheo / tribe_prevent_add_cart_empty.php
Created February 27, 2018 17:54
Prevents users from adding tickets to cart unless they have selected at least one ticket
/*
* 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(){
var tribe_empty_form_message = "Please select at least one item before submitting";
var tribe_cart_submit_button = jQuery( this ).find( "button[type=submit]" )[0];
@jentheo
jentheo / tickets.php
Created May 4, 2018 22:14
Set default ticket quantity to 1
<?php
/**
* Renders the WooCommerce tickets table/form
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/wootickets/tickets.php
*
* @version 4.7.1
*
@jentheo
jentheo / additional-fields.php
Last active May 21, 2018 09:37
URL additional field label
<?php
/**
* Single Event Meta (Additional Fields) Template
*
* Override this template in your own theme by creating a file at:
* [your-theme]/tribe-events/pro/modules/meta/additional-fields.php
*
* @package TribeEventsCalendarPro
*/
@jentheo
jentheo / single-day.php
Created August 16, 2017 23:46
Add class to recurring events after first event in series is over
<?php
/**
* Month View Single Day
* This file contains one day in the month grid
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-day.php
*
* @package TribeEventsCalendar
*
*/
<?php
// Function to add credits to cart (in main class)
public function listen_for_credit_purchases() {
// if ( ! wp_verify_nonce( '' ) ) {
// die( '-1' );
// }
$product_quantities = $_POST['product_quantity'];
@jentheo
jentheo / tickets.php
Created October 31, 2018 17:39
Set default ticket quantity to 1
<?php
/**
* Renders the WooCommerce tickets table/form
*
* Override this template in your own theme by creating a file at:
*
* [your-theme]/tribe-events/wootickets/tickets.php
*
* @version 4.8.3
*
@jentheo
jentheo / 119271-workaround.php
Created December 28, 2018 19:42
Temporary workaround for 119271
function tribe_mobile_default_view(){
?>
<script>
if(typeof tribe_ev !== "undefined"){
tribe_ev.fn.maybe_default_view_change = function(){
if (tribe_ev.data.redirected_view || !tribe_ev.data.default_view || !tribe_ev.data.default_mobile_view || tribe_ev.data.default_view == tribe_ev.data.default_mobile_view || !tribe_ev.state.view || tribe_ev.data.default_mobile_view == tribe_ev.state.view) {
return false;
}
var $body = jQuery( 'body' );
if ( ! $body.hasClass( 'tribe-mobile' ) ) {