Last active
August 29, 2015 14:00
-
-
Save ScreamingDev/11135721 to your computer and use it in GitHub Desktop.
WordPress Shell Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Like to do a shell import? | |
| * | |
| * Place this in wp-content/plugins/foo-plugin/bin/import.php | |
| */ | |
| function out( $txt ) { | |
| if ( func_num_args() > 1 ) { | |
| $txt = vsprintf( $txt, array_slice( func_get_args(), 1 ) ); | |
| } | |
| fputs( STDOUT, $txt . PHP_EOL ); | |
| } | |
| $baseDir = posix_getcwd(); | |
| while ( ! realpath( $baseDir . '/wp-load.php' ) ) { | |
| $baseDir = dirname( $baseDir ); | |
| } | |
| define( 'DOING_AJAX', true ); | |
| define( 'WP_ADMIN', true ); | |
| require_once $baseDir . '/wp-load.php'; | |
| out( 'DONE' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment