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 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 20, 2020
How to remove (dequeue) The Events Calendar's and PRO's styles.
View functions.php
<?php
// If you use this snippet as-is, ALL of The Events Calendar (i.e. "Core") and Pro add-on styles will NOT be loaded.
// (although there may be some $handles that I didn't detect... especially from widgets, shortcodes, and the like... no guarantess ;-)
// Comment out the line of each style you DO want to load.
// Note the comments within each array regarding the Display style options -- https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/#display
// The Display styles are "stacked".
// In other words, the Skeleton files are always loaded, and the Full styles are loaded when Tribe Events Styles (i.e. Theme) is selected.
// However, the commented .css example file names can change, e.g. 'full.min.css' instead of 'skeleton.min.css' or 'theme-mobile.min.css' instead of 'full-mobile.min.css'
//
@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 10, 2020
The Events Calendar and related plugins: Add your own location for template file loading.
View functions.php
<?php
/**
* The Events Calendar and related plugins: Add your own location for template file loading.
*
* Example "Single Event within List View" for Avada theme (which has theme overrides).
* Now tries to load in this order:
* This plugin: /app/public/wp-content/plugins/my-plugin/tribe-events/list/single-event.php
* Theme root so it stays even if switch themes: /app/public/wp-content/themes/tribe-events/list/single-event.php
* Child theme with theme overrides: /app/public/wp-content/themes/Avada-Child-Theme/tribe-events/list/single-event.php
@cliffordp
cliffordp / netflix-ratings.js
Last active Feb 8, 2020
Export Netflix's My List, Watch History, and thumbs up/down or ratings. Screenshot of Netflix Ratings vs script's output: https://cl.ly/4e15a4de21a6
View netflix-ratings.js
// These instructions for exporting Netflix's My List, Watch History, and Ratings worked for each profile on August 4, 2019.
// 1) Go to https://www.netflix.com/browse/my-list and use https://addons.mozilla.org/firefox/addon/netflix-list-exporter/ to copy.
// 2) Go to https://help.netflix.com/en/node/101917 and follow instructions to download CSV of Watch History.
// 3) Use the snippet below in the browser's console at https://www.netflix.com/MoviesYouveSeen, then copy and paste to wherever you wish.
// Code was altered from https://www.coollector.com/netflix_import.html, but I haven't ever used their software.
// 4) Go to https://www.netflix.com/cancelplan and cancel (if that's why you're doing all this):
@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({
@cliffordp
cliffordp / functions.php
Last active Jan 28, 2020
The Events Calendar: Change Event Archives' iCalendar export links to webcal://
View functions.php
<?php
/**
* The Events Calendar: Change Event Archives' iCalendar export links to webcal://
*
* This causes the "iCal Export" button to recommend to calendar applications
* (e.g. Apple, Outlook, etc.) that they should *subscribe* instead of *download*.
*
* We have to use JavaScript instead of PHP because the "Export Events"
* iCalendar link gets built via JS via
* /wp-content/plugins/the-events-calendar/src/resources/js/tribe-events.min.js
@cliffordp
cliffordp / a_faster_load_textdomain.php
Created Jan 28, 2020 — forked from soderlind/a_faster_load_textdomain.php
A faster load_textdomain for WordPress
View a_faster_load_textdomain.php
<?php
/*
Plugin Name: A faster load_textdomain
Version: 0.0.1
Description: While we're wating for https://core.trac.wordpress.org/ticket/32052.
Author: Per Soderlind
Author URI: https://soderlind.no
Plugin URI: https://gist.github.com/soderlind/610a9b24dbf95a678c3e
@link https://bjornjohansen.no/wordpress-translations-loading-time
License: GPL
@cliffordp
cliffordp / functions.php
Last active Jan 28, 2020
The Events Calendar - Get the next upcoming Featured Event
View functions.php
<?php
/**
* The Events Calendar - Get the next upcoming Featured Event
*
* Notes:
* 1) Ignores all-day events.
* 2) For the date comparison, this code assumes each event is in
* the same timezone as your WordPress General Settings timezone.
*
You can’t perform that action at this time.