Skip to content

Commit

Permalink
Fixes littlebizzy#11 - plugin exits when run from cli script.
Browse files Browse the repository at this point in the history
  • Loading branch information
apinstein committed Jan 24, 2019
1 parent 46711eb commit 0f637da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion force/redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ final class Redirect extends Helpers\Singleton {
* Initialize the redirection process
*/
protected function onConstruct() {
if (php_sapi_name() == "cli") {
// do nothing when we are in CLI mode
return;
}
add_action('init', [$this, 'init'], PHP_INT_MAX);
}

Expand Down Expand Up @@ -90,4 +94,4 @@ private function removeHeaders() {



}
}

0 comments on commit 0f637da

Please sign in to comment.