Skip to content

Instantly share code, notes, and snippets.

View jazzsequence's full-sized avatar
Hacking, probably.

Chris Reynolds jazzsequence

Hacking, probably.
View GitHub Profile
jazzsequence / add_unfiltered_html_to_editors.php
Last active March 19, 2024 01:25
Add `unfiltered_html` capability to editors on multisite.
* Add `unfiltered_html` capability to editors (or other user roles).
* On WordPress multisite, `unfiltered_html` is blocked for everyone but super admins. This gives that cap back to editors
* and above.
* @author Justin Tadlock
* @link
* @param array $caps An array of capabilities.
* @param string $cap The capability being requested.
jazzsequence /
Last active March 7, 2024 21:41
Bash script to check a Pantheon plugin's Tested Up To value against its fixture site's WordPress version and the current WordPress version.
set -euo pipefail
DIRNAME=$(dirname "$0")
jazzsequence /
Last active January 24, 2024 16:59
Download JT$ gif collection

Download Sternberg Gifs

When I worked at WebDevStudios, we spoke in gifs. I guess, these days, that makes me old. Whatever. I miss them. It represented a shared language even when the source of the gif was unknown. (I remember distinctly how it felt when I found the Key and Peele sketch from which this gem was taken:)


(It kinda felt like that ☝️)

Justin Sternberg even wrote an Alfred workflow called WDS Giffy which predated (in practice, if not in actuality) the gif-sharing service Giphy that pointed to his personal collection of gifs. I can't say for certain, but I think most of us used that, at least while I was there.

* Renders the admin page.
function admin_page() {
$screen = get_current_screen();
$parent = get_admin_page_parent();
$user_meta = get_usermeta( get_current_user_id(), 'wordpress_screen_options_demo_options' );
<div class="wrap <?php echo esc_attr( $parent ); ?>">
jazzsequence /
Created November 9, 2023 21:21
Update a Pantheon site's WordPress version to a _specific_ version if multiple updates are available.

When multiple WordPress versions have passed without updates being applied to your site, you will get a list of the updates in your Pantheon dashboard but no way to apply specific updates to your site.

Screenshot 2023-11-09 at 12 58 26 PM

Generally, the only way to apply those updates is to click the Apply Updates button or use terminus upstream:updates:apply, but either of those options will give you all the updates. What if you only wanted to update to a specific WordPress version?

That's what this guide is here to illustrate!

Step 1: Add pantheon-systems/WordPress as a Git remote

jazzsequence / ps-demo-plugin.php
Created May 24, 2013 23:06
Demonstration plugin for my Introduction to WordPress Plugin Development course for Pluralsight. Download the full source here:
Plugin Name: Pluralsight plugin development demo
Description: This is a demonstration plugin for the Introduction to WordPress Plugin Development course on Pluralsight.
Author: Chris Reynolds
Version: 1.0
function ps_plugindev_options_page() {
jazzsequence /
Created October 30, 2018 18:20
Template for How I Like to Work posts

How I work

This is my own interpretation of how I like to work, feedback welcome! Especially if my own view of how I think I like to work doesn't match your experience of how it seems I like to work!

When I work

* Display a screen option.
* @param string $title The title to display.
* @param string $option The name of the option we're displaying.
function show_option( $title, $option ) {
$screen = get_current_screen();
$id = "wordpress_screen_options_demo_$option";
jazzsequence / end.gcode
Last active December 27, 2022 10:45
Start and End G-code for Ender 5 on Cura
; Ender 5 Custom End G-code
G4 ; Wait
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
G1 F1800 E-3 ; Retract filament 3 mm to prevent oozing
G1 F3000 Z20 ; Move Z Axis up 20 mm to allow filament ooze freely
G90 ; Set coordinates to absolute
G1 X0 Y220 F1000 ; Move Heat Bed to the front for easy print removal
M106 S0 ; Turn off cooling fan
jazzsequence /
Last active October 12, 2022 20:36
Roots Sage install script on Pantheon
echo "Enter the site name. \n
This will be used to clone your site locally to /{User}/pantheon-local-copies/{site_name) and to interact with your site."
read $sitename
echo "Enter your theme name. \n