avoid messing-up with wp-cli (#96)

When using wp-cli (eg: rewrite/cache flush), init() will run setcookie() which would trigger "headers already sent by". Just disable module when wp-cli is being used.
isekai
Raphaël Droz 7 years ago committed by Jonathan Daggerhart
parent 72305fcc9f
commit 87470689db

@ -73,6 +73,10 @@ class OpenID_Connect_Generic {
* WP Hook 'init' * WP Hook 'init'
*/ */
function init(){ function init(){
if ( defined( 'WP_CLI' ) && WP_CLI ) {
return;
}
$redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' );
if ( $this->settings->alternate_redirect_uri ){ if ( $this->settings->alternate_redirect_uri ){

Loading…
Cancel
Save