[wp-trac] [WordPress Trac] #59000: Add a check for wp_get_current_user to current_user_can

WordPress Trac noreply at wordpress.org
Tue Aug 8 12:03:27 UTC 2023


#59000: Add a check for wp_get_current_user to current_user_can
-----------------------------------+------------------------------
 Reporter:  scruffian              |       Owner:  (none)
     Type:  defect (bug)           |      Status:  new
 Priority:  normal                 |   Milestone:  Awaiting Review
Component:  Users                  |     Version:
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:3 johnbillion]:
 > Changing the function to return false if `wp_get_current_user()` isn't
 defined just papers over the incorrect usage.

 Same thoughts here, it seems like this check should perhaps be in
 `wp_get_theme_preview_path()` instead.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59000#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list