Skip to content

Instantly share code, notes, and snippets.

@paulgibbs
Created October 21, 2016 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulgibbs/1f0c9b60374c45c4f0f1ed27bcd9f952 to your computer and use it in GitHub Desktop.
Save paulgibbs/1f0c9b60374c45c4f0f1ed27bcd9f952 to your computer and use it in GitHub Desktop.
Index: src/wp-includes/capabilities.php
===================================================================
--- src/wp-includes/capabilities.php (revision 38699)
+++ src/wp-includes/capabilities.php (working copy)
@@ -470,7 +470,7 @@
$current_user = wp_get_current_user();
- if ( empty( $current_user ) ) {
+ if ( ! $current_user->ID ) {
if ( $switched ) {
restore_current_blog();
}
@paulgibbs
Copy link
Author

Looking at WP style a bit more, this would probably actually be replaced with if ( ! $user->exists() ) {, which does pretty much the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment