Skip to content

Instantly share code, notes, and snippets.

<?php
// If you're a host, and you have a plugin installed on every site,
// either of the below hotfixes will allow WordPress 4.9.3 to update to 4.9.4.
// Option 1:
// Fix the dependancies before the fatal is encountered:
add_action( 'set_site_transient_update_core', function( $val ) {
global $wp_version;
if ( wp_doing_cron() && '4.9.3' == $wp_version && !empty( $val->updates ) ) {
<?php
/*
* Plugin Name: Cron Example for https://core.trac.wordpress.org/ticket/42660
*/
class Cron_example_42660 {
function __construct() {
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
add_action( 'cron_single_event', array( $this, 'cron_callback' ) );
}
@dd32
dd32 / live-coding-example.php
Created November 20, 2017 04:03
Gutenberg giphy live demo plugin
<?php
// mu-plugin for stepping through https://github.com/obenland/giphy-block/
// has some dynamic modifications to avoid JS errors / use a better gif
class LiveDemo {
static $steps = array(
'425c485' => '0: Boilerplate',
'c98c358' => '1: Register a block',