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-old.php
Last active Mar 20, 2020
The Events Calendar: Change the Event Website plain text link to a button, including shortening the anchor text to avoid a really long button.
View functions-old.php
<?php
/**
* The Events Calendar: Change the Event Website plain text link to a button, including shortening the anchor text to
* avoid a really long button.
*
* @link https://gist.github.com/cliffordp/e19775ce3eb7a66fb72ba38a24959546 This snippet.
* @link https://theeventscalendar.com/knowledgebase/k/make-the-event-website-url-a-linked-word-or-button/ KB article with this and other snippets.
* Screenshots with Twenty Twenty theme:
* @link https://share.getcloudapp.com/X6uz7NNZ without this snippet (before).
* @link https://share.getcloudapp.com/geu2PzzE with this snippet (after).
@cliffordp
cliffordp / functions.php
Created Mar 20, 2020
Community Events: Disable the "Venue Details" linked post type box from the "Add New Event" and "Edit Event" forms.
View functions.php
<?php
/**
* Community Events: Disable the "Venue Details" linked post type box from the "Add New Event" and "Edit Event" forms.
*
* @link https://gist.github.com/cliffordp/2b9369b9c2911fcef05ad10620d954e7 This snippet.
*
* @param array $templates
* @param string $slug
*
* @return array
@cliffordp
cliffordp / functions.php
Last active Mar 12, 2020
Event Tickets (v4.11.5+): Override the maximum quantity allowed to be purchased in a single Add To Cart action.
View functions.php
<?php
/**
* Event Tickets (v4.11.5+): Override the maximum quantity allowed to be purchased in a single Add To Cart action.
*
* @link https://gist.github.com/cliffordp/d5254fa306fa0c4ec1a27e73a083755e This snippet.
* @link https://theeventscalendar.com/knowledgebase/k/settings-overview-event-tickets-and-event-tickets-plus/#Ticket_settings Help article.
*
* @param Tribe__Tickets__Ticket_Object $ticket Ticket object.
* @param WP_Post $event Event post.
* @param int $ticket_id Raw ticket ID.
@cliffordp
cliffordp / functions.php
Last active Feb 28, 2020
The Events Calendar (TEC) and Event Tickets (ET): Get the total number of unique events for which a user has obtained tickets (of any kind, including RSVP) within the specified Event Category.
View functions.php
<?php
/**
* The Events Calendar (TEC) and Event Tickets (ET): Get the total number of unique events for which a user has
* obtained tickets (of any kind, including RSVP) within the specified Event Category.
*
* Could be turned into a shortcode. Could be used in a way to output a friendly message like,
* "Thanks for attending *14* events in the *Sports* category."
* This function currently gives you the *14* part of this message but could easily be extended.
*
* @link https://gist.github.com/cliffordp/ddb9e11015c193afd1eea78a54afdf79 This snippet.
@cliffordp
cliffordp / functions.php
Last active Feb 26, 2020
Events Calendar Pro: Photo View (v2 views): Insert venue details below event title.
View functions.php
<?php
/**
* Events Calendar Pro: Photo View (v2 views): Insert venue details below event title.
*
* @link https://gist.github.com/cliffordp/d442b6ef4b1ba5530d4c30dea0314b40 This snippet.
* @link https://share.getcloudapp.com/9ZuAAEyB Screenshot.
* @link https://theeventscalendar.com/knowledgebase/k/using-template-filters-and-actions/ Helpful reference.
*/
function cliff_photo_view_insert_venue_details() {
$address = tribe_get_venue_single_line_address( get_the_ID() );
View gist:0780d5a8a88a3cbf1dcb7000646fc536
<?php
/**
* Quick hack to preview WooCommerce e-mails.
* Based on drrobotnik's answer from Stack Overflow: http://stackoverflow.com/a/27072101/186136
*
* Add this to <yourtheme>/functions.php and then visit a url like:
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail
*
* @return null
*/
@cliffordp
cliffordp / functions.php
Last active Feb 21, 2020
The Events Calendar (v2 views): Add Thickbox to single event's featured image.
View functions.php
<?php
/**
* The Events Calendar (v2 views): Add Thickbox to single event's featured image (also make smaller and centered).
*
* @link https://gist.github.com/cliffordp/b3745850fd2ab2aab1d4f104ed05ef93 This snippet.
* @link https://share.getcloudapp.com/E0uqlBJp Quick demo video.
*
* @see cliff_tec_featured_image_thickbox_class()
*/
@cliffordp
cliffordp / functions.php
Last active Feb 14, 2020
The Events Calendar (V2 Views): Remove the "This event has passed." notice from single events.
View functions.php
<?php
/**
* The Events Calendar (V2 Views): Remove the "This event has passed." notice from single events.
*
* FYI: There are other places this same notice displays, such as embed view. To remove the notice from everywhere,
* remove the code snippet's "if..." logic.
*
* @link https://gist.github.com/cliffordp/82836c507db01515745db6e5172f4f76 This snippet.
* @link https://share.getcloudapp.com/YEud5m7d Screenshot of the notice that gets removed.
*/
@cliffordp
cliffordp / functions.php
Last active Feb 7, 2020
Override The Events Calendar's V2 Views from a custom plugin location
View functions.php
<?php
/**
* Add your own plugin as a template override location for The Events Calendar, Event Tickets, and related plugins. Only
* for TEC's V2 Views and ET's addons/overrides of TEC's V2 Views. Still need the old snippet for overriding ET's files.
*
* Each custom array's `path` is whatever you want it to be (i.e. customizable) up until the 'v2' part of each
* template's override path. We chose to keep it as `tribe/events` and `tribe/tickets` for simplicity.
* So if the TEC location for a view is:
* /wp-content/plugins/the-events-calendar/src/views/v2/list/event/featured-image.php
* Then this plugin's override location would be:
View sync-files-chart.html
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://vera183.its.monash.edu.au/static/js/lib/jquery-1.7.1.min.ddb84c158728.js"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var jsonData = $.ajax({
You can’t perform that action at this time.