Skip to content

Instantly share code, notes, and snippets.

Weston Ruter westonruter

Block or report user

Report or block westonruter

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 widgets-right.patch
diff --git src/wp-admin/customize.php src/wp-admin/customize.php
index d3b09f2..b1485d1 100644
--- src/wp-admin/customize.php
+++ src/wp-admin/customize.php
@@ -118,6 +118,7 @@ do_action( 'customize_controls_print_scripts' );
$cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
?>
+ <div id="widgets-right"><!-- For Widget Customizer, many widgets try to look for instances under div#widgets-right, so we have to add that ID to a container div in the customizer for compat -->
<div class="wp-full-overlay-sidebar-content accordion-container" tabindex="-1">
View bd-logger.js
BDM.trigger = (function(){ var old_trigger = BDM.trigger; return function(){ console.info( 'Called BDM.trigger with arguments', arguments ); return old_trigger.apply( BDM, arguments ) }; }())
View theme-plugin-profiling.php.diff
diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php
index df4ba8d..3a703de 100644
--- a/wp-includes/plugin.php
+++ b/wp-includes/plugin.php
@@ -196,7 +196,9 @@ function apply_filters( $tag, $value ) {
foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) ){
$args[1] = $value;
+ xteam_push_plugin_hook_profile( $tag, $the_['function'] );
$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
View class-wp-ajax-action.php
<?php
abstract class WP_Ajax_Action {
public $nopriv = true;
public $capability = 'read';
public $name = '';
@westonruter
westonruter / debug-bar-console-import-postmeta.php
Last active Aug 29, 2015
Hacky. Past this into a WP-CLI shell, for example, to grab an export of postmeta to paste into Debug Bar Console on another server.
View debug-bar-console-import-postmeta.php
<?php
$source_post_id = 123;
$dest_post_id = 456;
foreach( get_post_custom( $source_post_id ) as $key => $values ) { $value = array_shift( $values ); printf( 'update_post_meta( %d, %s, %s );' . PHP_EOL, var_export( $dest_post_id, true ), var_export( $key, true ), var_export( $value, true ) ); }
@westonruter
westonruter / wp-cron.php.diff
Created Jun 25, 2014
Add status responses to wp-cron.php
View wp-cron.php.diff
diff --git src/wp-cron.php src/wp-cron.php
index 2b965dd..c59a371 100644
--- src/wp-cron.php
+++ src/wp-cron.php
@@ -9,19 +9,20 @@
* @package WordPress
*/
-ignore_user_abort(true);
+ignore_user_abort( true );
View keybase.md

Keybase proof

I hereby claim:

  • I am westonruter on github.
  • I am westonruter (https://keybase.io/westonruter) on keybase.
  • I have a public key whose fingerprint is 1564 8661 5D28 6E08 48D2 A84A EA2D F8EF 632F BCAE

To claim this, I am signing this object:

View update_option_no_autoload.php
<?php
/**
* Safely update an option which may not exist yet, doing add_option() with
* autoload=no if it doesn't. Prevent proliferation of autoloaded options.
*
* Note we check to see if the option exists so we get a chance to
* call add_option with the autoload argument. This is an ugly
* aspect of WordPress. This is a performance consideration, to
* prevent WordPress from needlessly querying these options with
View sample.js
/*global jQuery, _sampleExports */
/*exported Sample */
var Sample = ( function ( $ ) {
'use strict';
var self = {
foo: '',
nonce: ''
};
$.extend( self, _sampleExports );
View git-internal-submodule-init.sh
#!/bin/bash
# git-internal-submodule-init.sh
# Author: Weston Ruter (@westonruter), X-Team WP
show_usage()
{
echo "
Usage: $0 path/to/submodule [initial_commit]
Create a submodule pointing to a branch (prefixed by 'internal-submodules/') in
You can’t perform that action at this time.