Skip to content

Commit

Permalink
Disabled for WP-CLI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmhendricks committed Nov 17, 2018
1 parent 623da6f commit dc6fce2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Use [HtmlPageDom](https://github.com/wasinger/htmlpagedom) in conjunction for jQ
This code will replace any instance of "foo" on the web page with "bar":

```
add_filter( 'final_output', function($output) {
add_filter( 'final_output', function( $output ) {
return str_replace( 'foo', 'bar', $output );
});
```
Expand Down
4 changes: 2 additions & 2 deletions output-buffering.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: Output Buffering
* Plugin URI: https://github.com/dmhendricks/wordpress-output-buffering
* Description: Buffers the entire WP process, capturing the final output for manipulation.
* Version: 1.0.4
* Version: 1.0.5
* Author: Daniel M. Hendricks
* Original Author: kfriend (https://stackoverflow.com/users/419673/kfriend)
* Author URI: https://www.danhendricks.com
Expand Down Expand Up @@ -80,7 +80,7 @@ private function get_load_screens() {
*/
private function can_load() {

if( strpos( $_SERVER['REQUEST_URI'], '/wp-json' ) === 0 ) return false;
if( strpos( $_SERVER['REQUEST_URI'], '/wp-json' ) === 0 || ( defined( 'WP_CLI' ) && WP_CLI ) ) return false;

$load_screens = $this->get_load_screens();
$load_admin = is_admin() && in_array( 'admin', $load_screens );
Expand Down

0 comments on commit dc6fce2

Please sign in to comment.