Skip to content

Instantly share code, notes, and snippets.

@nullvariable

nullvariable/wp-cli.php

Last active Feb 27, 2019
Embed
What would you like to do?
use wp-cli as a proxy for typerocket galaxy commands
<?php
if ( defined( 'WP_CLI' ) && WP_CLI ) {
\WP_CLI::add_command( 'galaxy', function () {
$count = count( $_SERVER['argv'] );
for ( $i = 0; $i < $count; $i++ ) {
// strip any preceeding arguments so galaxy isn't confused.
$arg = array_shift( $_SERVER['argv'] );
if ( 'galaxy' == $arg ) {
array_unshift( $_SERVER['argv'], 'galaxy' );
break;
}
} );
}
@nullvariable

This comment has been minimized.

Copy link
Owner Author

@nullvariable nullvariable commented Feb 27, 2019

hat tip to @mbucurcf for this handy snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment