Skip to content

Instantly share code, notes, and snippets.


Per Søderlind soderlind

View GitHub Profile
soderlind /
Last active Mar 12, 2020 — forked from bjornjohansen/
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See for more details.
# Modified by Per Søderlind
MAIN_SITE="http://www.domain.tld" # --url="$MAIN_SITE" below, prevents the Undefined index: HTTP_HOST error.
soderlind /
Created Sep 5, 2018 — forked from morganestes/
Create multiple sites with wp-cli in WordPress multisite for testing.

These commands will install multiple dummy sites in a WordPress Multisite environment.

I wrote this to easily create an environment to work on



In the terminal, inside your WordPress directory: simply copy, paste, and run the one-line command.

You can also add it to a location available in your $PATH and invoke the script from the shell.

soderlind / licence activation.php
Created May 16, 2016 — forked from mattradford/licence activation.php
ACF5 Pro licence activation. Could be adapted for any other plugin that requires a licence key, but doesn't yet support defining it in wp-config. Fires on theme activation.
View licence activation.php
// Place this in wp-config
define( 'ACF_5_KEY', 'yourkeyhere' );
// Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent.
function auto_set_license_keys() {
if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) {
$save = array(
'key' => ACF_5_KEY,
soderlind /
Created Dec 4, 2012 — forked from paulcook/ for Pow + Wordpress - based on Added rewrite rule for WordPress Multi Site. More at
# for Pow + Wordpress, based on
# added hackery to work around wordpress issues - Patrick Anderson (
# added rubygems, replaced script_path with script from path_parts, added to_return to fix return error - Paul Cook
# clearly this could be cleaner, but it does work
# added rewrite rule for WordPress Multi Site - Per Soderlind (see also
require 'rubygems'
require 'rack'
require 'rack-legacy'
require 'rack-rewrite'
You can’t perform that action at this time.