Skip to content

Instantly share code, notes, and snippets.

Clifford cliffordp

  • Oklahoma
Block or report user

Report or block cliffordp

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
@cliffordp
cliffordp / functions.php
Last active Jul 11, 2019
Event Tickets: Set the maximum quantity allowed per ticket.
View functions.php
<?php
/**
* Event Tickets Plus (ET+): Limit to purchasing 4 WooCommerce tickets at a time for a specific event and/or ticket.
*
* !!! Change the maximum and Event ID to your own values!!!
* Requires ET+ version 4.10.7 or later to also work for tickets with an unlimited stock/quantity (value of "-1").
*
* @link https://gist.github.com/cliffordp/61cd8374a80d1b2bc76a6650e9304a63 This snippet.
*
@cliffordp
cliffordp / functions.php
Created Dec 3, 2018
The Events Calendar: All Venue slugs get prefixed with a custom string. Works in wp-admin and Community Events.
View functions.php
<?php
/**
* The Events Calendar: All Venue slugs get prefixed with a custom string. Works in wp-admin and Community Events.
*
* !!! Change the prefix to your own !!!
*
* @link https://gist.github.com/cliffordp/ac4a68769787352369ab0c5e41dc28ab This snippet.
*/
function cliff_prefix_venue_slugs( $data ) {
// TODO: Change this to what you want!!!
@cliffordp
cliffordp / functions.php
Last active Nov 21, 2018
Events Calendar PRO: Set the "Show only the first instance of each recurring event (only affects list-style views)" option only on certain page/post IDs.
View functions.php
<?php
/**
* Events Calendar PRO: Set the "Show only the first instance of each recurring event (only affects list-style views)"
* option only on certain page/post IDs.
*
* Useful if you are embedding a List View within a specific page, such as via shortcode or widget, and you want to hide
* the recurrences ONLY in this context.
* !!! CHANGE TO YOUR OWN POST IDs WITHIN THIS SNIPPET'S CODE !!!
*
* @link https://gist.github.com/cliffordp/69d00ce54929393410e27a319762d241 This snippet.
@cliffordp
cliffordp / style.css
Last active Nov 19, 2018
TEC Month View: blackout all July Fourths, since the library is closed. Screenshot: https://cl.ly/ad0626fcb03e
View style.css
/**
* TEC Month View: blackout all July Fourths, since the library is closed.
* Screenshot: https://cl.ly/ad0626fcb03e
* From: https://gist.github.com/cliffordp/90757a9fccc5b19431be12fa49839b49
*/
#tribe-events .tribe-events-month td[data-day$="07-04"],
#tribe-events .tribe-events-month td[data-day$="07-04"]:hover,
#tribe-events .tribe-events-month td[data-day$="07-04"] a,
#tribe-events .tribe-events-month td[data-day$="07-04"] a:hover,
#tribe-events .tribe-events-month td[data-day$="07-04"] h3,
@cliffordp
cliffordp / functions.php
Created Nov 10, 2018
Pseudo code for putting the WooCommerce Bookings Form anywhere, such as via a shortcode. READ THE CODE COMMENTS
View functions.php
<?php
/**
* Pseudo code for putting the WooCommerce Bookings Form anywhere, such as via a shortcode.
* !!! READ THE CODE COMMENTS !!!
*
* @link http://ideas.woocommerce.com/forums/133476-woocommerce/suggestions/34526179-creating-shortcode-booking-search-form-with-date-r
*
* @see WC_Booking_Cart_Manager::add_to_cart()
*
@cliffordp
cliffordp / functions.php
Created Nov 6, 2018
Events Calendar PRO: Add {pro_addl_fields} variable to the tribe_event_inline shortcode.
View functions.php
<?php
/**
* Events Calendar PRO: Add {pro_addl_fields} variable to the tribe_event_inline shortcode.
*
* @see cliff_render_pro_addl_fields_within_inline_shortcode()
*
* @link https://gist.github.com/cliffordp/376e8c204ccd34ec78fbc38d519350ef This snippet.
* @link https://theeventscalendar.com/knowledgebase/embedding-single-events-tribe_event_inline-shortcode/
* @link https://theeventscalendar.com/knowledgebase/pro-additional-fields/
*/
@cliffordp
cliffordp / functions.php
Last active Oct 30, 2018
The Events Calendar (TEC) and WooCommerce: Add TEC's taxonomy to Products post type.
View functions.php
<?php
/**
* The Events Calendar (TEC) and WooCommerce: Add TEC's taxonomy to Products post type.
*
* @link https://gist.github.com/cliffordp/94033d6d1558a84fa9a3214e1f850cda This snippet.
*/
function cliff_add_tec_cat_to_woo_products( $taxonomy, $object_type ) {
if (
! class_exists( 'Tribe__Events__Main' )
|| Tribe__Events__Main::TAXONOMY !== $taxonomy
@cliffordp
cliffordp / functions.php
Last active Oct 27, 2018
The Events Calendar (TEC) and Event Aggregator (EA): Add further-future import limits.
View functions.php
<?php
/**
* The Events Calendar (TEC) and Event Aggregator (EA): Add further-future import limits.
*
* @link https://gist.github.com/cliffordp/7e687ec1d1cd7d89d2fa05af5b595d1f This snippet.
*
* @see \Tribe__Events__Aggregator__Settings::get_range_options()
*/
function cliff_ea_add_further_future_import_range_options( $options ) {
// Add months 4-11
View examples.php
<?php
/**
* Usage examples that require https://github.com/cliffordp/gf-gw-req-char-length version 2.0.0+.
*
* This gist's changelog:
*
* Version 1.0.0 - October 26, 2018
* - Initial version of this gist example.
*/
@cliffordp
cliffordp / functions.php
Created Oct 26, 2018
The Events Calendar (TEC) and Event Aggregator (EA): Link Site B's imported TEC events to their canonical Event Tickets location on Site A. Displays a big button on Site B's single events pages.
View functions.php
<?php
/**
* The Events Calendar (TEC) and Event Aggregator (EA): Link Site B's imported TEC events to their canonical Event
* Tickets location on Site A. Displays a big button on Site B's single events pages.
*
* Useful when you want to import and display Site A's events (running TEC and ET/ET+) on Site B (running TEC and EA).
* WARNING: Watch out if you're also importing from other sources, like Google, Eventbrite, etc.
* Read this snippet's code comments to make sure you understand what this code does and what it does not do.
*
* @link https://gist.github.com/cliffordp/aab5ea85e9bd409d09cb8e22a3690a25 This snippet.
You can’t perform that action at this time.