Skip to content

Instantly share code, notes, and snippets.

John Blackbourn johnbillion

Block or report user

Report or block johnbillion

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
View template-part-block-renderer.php
<?php
namespace Foo\Blocks;
/**
* Generic block rendering callback function to load a block from a theme template part.
*
* Loads a block from the `blocks` subdirectory according to the name of the block, and places the
* block attributes and block content into namespaced query vars. If there's no corresponding block
* template part, the block content is returned unaltered.
@johnbillion
johnbillion / roles.sh
Created Nov 22, 2017
Create a user account for each role on your WordPress site
View roles.sh
# wp-cli: http://wp-cli.org/
wp role list --fields=role --format=csv \
| tail -n +2 \
| xargs -I {} wp user create "user-{}" "{}@example.com" --role={}
@johnbillion
johnbillion / install-debug-bar-extensions.sh
Last active Jul 31, 2018
Use WP-CLI to install a load of Debug Bar extensions (which work with Query Monitor too) in one go
View install-debug-bar-extensions.sh
# wp-cli: http://wp-cli.org/
wp plugin search debug-bar --field=slug --format=csv --per-page=50 \
| grep -F 'debug-bar-' \
| xargs -n 1 wp plugin install
@johnbillion
johnbillion / alphas.csv
Last active Nov 22, 2017
Commit hashes for the first alpha of each version of WordPress in the master branch
View alphas.csv
Version Commit Date
5.0 9f77ec13ffcf1ab14c8699fdb68e728709eb6bb5 2017-11-07
4.9 3c1dfef4ba5c8fe89b46c62f81395313c9814cf9 2017-06-01
4.8 26a28e6450496efc07b6b5fbc3383d3d5f17634a 2016-11-24
4.7 35c66918580f5ecfec1ec4c62feb93dae26d9b08 2016-08-02
4.6 65ec7e5d81f718ea305fe9ccf1b4dde76ee08280 2016-04-12
4.5 b5bbba202637fc51aba5f779ef63b43abaf92070 2015-12-06
4.4 e048854dc141d79365154fb80ac78b83eced2d70 2015-08-18
4.3 f8140ca9619b69a93f642652612916cc48b9feab 2015-04-23
4.2 6933f4329c933ca6bcbee24564922fe573778820 2014-12-10
@johnbillion
johnbillion / install-popular-themes.sh
Last active Feb 27, 2017
Install all the "Popular" themes from WordPress.org using wp-cli and jq
View install-popular-themes.sh
@johnbillion
johnbillion / install-all-languages.sh
Created Feb 18, 2017
Install all available languages on a WordPress site with WP-CLI
View install-all-languages.sh
wp core language list --field=language | xargs -n 1 wp core language install
View merge.sh
#!/bin/bash
REV=$1
svn up --ignore-externals . > /dev/null
svn merge -c$REV ../../trunk .
LOG=$(svn log -r$REV ../../trunk | grep -v '\-------' | tail -n +3)
BRANCH=$(basename $(pwd))
echo -en "$LOG\n\nMerges [$REV] to the $BRANCH branch." | pbcopy
echo ""
pbpaste
@johnbillion
johnbillion / wp_mail.md
Last active Apr 1, 2019
WordPress Emails
View wp_mail.md

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

View gist:07e7aa8ff42eea80a5f9
[alias]
changelog = "!_() { t=$(git describe --abbrev=0 --tags); git log ${t}..HEAD --no-merges --pretty=format:'* %s'; }; _"
You can’t perform that action at this time.