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 Oct 14, 2019
Set default quantity of 1 and READONLY for all tickets: Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
View functions.php
<?php
/**
* Set default quantity of 1 and READONLY for all tickets:
* - Event Tickets RSVP
* - Event Tickets Plus WooCommerce
* - Event Tickets Plus Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/80b33455779b74ec49f6ea3033cb47bf
*
* Same as https://gist.github.com/cliffordp/5b57df71be8b52f595817ddbf81acdab except make quantity readonly
View programmatically-add-gravity-forms.php
<?php
/*
Plugin Name: Programmatically add Gravity Forms
Plugin URI: https://daan.kortenba.ch/programmatically-add-gravity-forms/
Description: Programmatically add persistent Gravity Forms forms.
Author: Daan Kortenbach
Version: 0.1
Author URI: https://daan.kortenba.ch/
License: GPLv2 or later
*/
@cliffordp
cliffordp / functions.php
Last active Sep 30, 2019
Adding custom SmugMug domain to oEmbed whitelist in WordPress (simple version)
View functions.php
<?php
// From https://tourkick.com/advice-tips-howto/smugmug-custom-domain-oembed-wordpress/
// Works but full regex version could be used instead: https://gist.github.com/cliffordp/7afaa8700d2a5711e9d6
wp_oembed_add_provider( 'https://media.tourkick.com/*', 'https://api.smugmug.com/services/oembed/' );
@cliffordp
cliffordp / functions.php
Last active Sep 26, 2019
Prefix a string with "MyOhMy_" to easily identify that this function is happening on the passed text.
View functions.php
<?php
/**
* Prefix a string with "MyOhMy_" to easily identify that this function is happening on the passed text.
*
* Requires Event Tickets v4.10.9 (October 2019) or later. Functions are found in
* /wp-content/plugins/event-tickets/src/template-tags/tickets.php
*
* @link https://gist.github.com/cliffordp/9d878488e5def7419c8bb906f8929d15 This snippet.
* @link https://central.tri.be/issues/128298 Used to QA this ticket.
* @link https://cl.ly/403a9c5fe5e7 Screenshot of this snippet working on Attendees Report.
@cliffordp
cliffordp / functions.php
Created Sep 23, 2019
Add JSDelivr as a prefetch resource provider to speed up page load times in WordPress
View functions.php
<?php
add_filter( 'wp_resource_hints', 'your_add_resource_hints', 10, 2 );
/**
* Try to improve performance with resource hints.
*
* WP will output protocol-relative 'dns-prefetch' for all scripts and styles which are enqueued
* from external hosts.
* WP will not do 'preconnect', 'prefetch', or 'prerender' automatically.
View example-alfred-app-workflow.php
<?php
//
// Do NOT USE OPENING <?php TAG IN ALFRED APP
//
/**
* Open 1 or more (comma or new line separated) issue number URLs from selection.
*
* @link https://github.com/cliffordp/alfred-app-workflows Download this Alfred App Workflow's code (and more).
* @link https://gist.github.com/cliffordp/a0ce681f51504649cd75cc9c22a53b2a This Alfred App Workflow's code snippet.
@cliffordp
cliffordp / netflix-ratings.js
Last active Aug 5, 2019
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 Jul 18, 2019
Automatically login a single WordPress user upon arrival to a specific page.
View functions.php
<?php
/**
* Automatically login a single WordPress user upon arrival to a specific page.
*
* Redirect to home page once logged in and prevent viewing of the login page.
* Compatible with WordPress 3.9.1+
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1.
*
@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
Last active Jun 28, 2019
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
You can’t perform that action at this time.