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 Nov 8, 2019
Event Tickets Plus: Remove Attendee Information from ET's Ticket Email.
View functions.php
<?php
/**
* Event Tickets Plus: Remove Attendee Information from ET's Ticket Email.
*
* @see \Tribe__Tickets_Plus__Meta__Render::ticket_email_meta()
*
* @link https://gist.github.com/cliffordp/406d1b9ec611f7caed6602d0d1bc26b7 This snippet.
*/
add_filter( 'tribe_event_tickets_plus_email_meta_fields', '__return_empty_array', 50 );
View ext-xdebug.ini
[xdebug]
# Using https://github.com/w00fz/xdebug-osx/ so don't add `zend_extension` entry, as it would be duplicate
# https://xdebug.org/docs/all_settings
xdebug.remote_port=9001
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.var_display_max_depth=-1
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1
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 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.
@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 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
@cliffordp
cliffordp / functions.php
Last active Nov 4, 2019
Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.
View functions.php
<?php
/**
* Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.
*
* Irrelevant if default post status in CE settings is Published or Anonymous Submissions are not allowed.
*
* @link https://support.theeventscalendar.com/420384-Auto-publish-events-submitted-by-logged-in-users Relevant help article.
* @link https://gist.github.com/cliffordp/9b4dff692829ce5d9ddd46d849689dbb This snippet.
*
* @param mixed $option The option value.
@cliffordp
cliffordp / functions.php
Last active Jun 5, 2019
Get your WordPress.org favorite plugins
View functions.php
<?php
/**
* Get your WordPress.org favorite plugins.
*
* Set a breakpoint or var_dump() within plugins_api() at `if ( is_wp_error( $request ) ) {` to see the URL. Example:
* https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[user]=cliffpaulick&request[per_page]=250&request[fields][description]=0&request[fields][tested]=0&request[fields][requires]=0&request[fields][rating]=0&request[fields][ratings]=0&request[fields][downloaded]=0&request[fields][downloadlink]=0&request[fields][added]=0&request[fields][donate_link]=0&request[fields][icons]=0&request[locale]=en_US&request[wp_version]=5.2
*
* @link https://developer.wordpress.org/reference/functions/plugins_api/
*
* @see \plugins_api()
@cliffordp
cliffordp / functions.php
Last active Apr 14, 2019
WP All Import - set uploads folder to the Import ID
View functions.php
<?php
/**
* WP All Import: Upload media to a directory named after the Import ID.
*
* @link https://gist.github.com/cliffordp/fc0fa5686d6a127246224f1565b60128 This snippet.
* @link https://github.com/soflyy/wp-all-import-action-reference/blob/master/all-import/wp_all_import_images_uploads_dir.php
*
* @see PMXI_Import_Record::process()
* @see wp_upload_dir()
*
You can’t perform that action at this time.