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 / 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.
@cliffordp
cliffordp / gf_entries_october_nonadmin.php
Last active Oct 22, 2018
Get a count of Gravity Forms entries in October 2018 that are not trashed that were not created by an Administrator
View gf_entries_october_nonadmin.php
<?php
$admin_users = get_users( [ 'role' => 'administrator' ] );
$admin_user_ids = wp_list_pluck( $admin_users, 'ID' );
$entries_search = [
'status' => 'active', // non-trashed entries
'start_date' => '2018-10-01 00:00:00', // October 1
'end_date' => '2018-10-31 23:59:59', // October 31
'field_filters' => [
[
@cliffordp
cliffordp / private-debug-log.php
Created Oct 8, 2018 — forked from webaware/private-debug-log.php
Enable WordPress debug log to a private folder not accessible from the web. See http://wordpress.stackexchange.com/q/84132/24260 for details and motivations. NB: currently needs to be manually edited to specify the private folder path;
View private-debug-log.php
<?php
/*
Plugin Name: Private Debug Log
Description: Enable debug log to a private folder not accessible from the web
Version: 0.0.1
Author: WebAware
Author URI: http://www.webaware.com.au/
*/
/*
@cliffordp
cliffordp / functions.php
Last active Oct 4, 2018
The Events Calendar & Event Tickets Plus (ET+): Disable QR Code if ticket is for an event in a specific category.
View functions.php
<?php
/**
* The Events Calendar & Event Tickets Plus (ET+): Disable QR Code if ticket is for an event in a specific category.
*
* Requires ET+ 4.8.2 or later (when this filter was added).
* Useful for events where there is no physical check-in required, such as an online event or webinar.
*
* @link https://gist.github.com/cliffordp/7a819ccf8343cc19a07fd74b9f9aa762 This snippet.
*
* @param bool $enabled The bool that comes from the options.
You can’t perform that action at this time.