Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not redirect for WP-CLI #1891

Merged
merged 1 commit into from
May 19, 2017
Merged

Do not redirect for WP-CLI #1891

merged 1 commit into from
May 19, 2017

Conversation

tobeycodes
Copy link
Contributor

No description provided.

@QWp6t
Copy link
Sponsor Member

QWp6t commented May 7, 2017

I'd rather check if it's in cli mode (php_sapi_name() === 'cli') than check for WP_CLI specifically.

And we usually use guards. So final code would be...

 if ($sage_views !== get_option('stylesheet')) {
     update_option('stylesheet', $sage_views);
+    if (php_sapi_name() === 'cli') {
+        return;
+    }
     wp_redirect($_SERVER['REQUEST_URI']);
     exit();
  }

Thoughts?

@tobeycodes
Copy link
Contributor Author

I'm happy. We're not in a function so this will always have to remain at the end of the file.

@rfair404
Copy link
Contributor

Ah, thank you! I've run into the same issue (I assume) that @schrapel has. Attempting to run bitbucket pipelines CI to generate the blade templates since wp engine won't allow the blade templates to compile in production env's.

@QWp6t QWp6t merged commit 74b485b into roots:master May 19, 2017
@tobeycodes
Copy link
Contributor Author

@rfair404
Copy link
Contributor

@schrapel I have and It has helped me a lot, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants