[wp-trac] [WordPress Trac] #33306: Only Query for author ID if user is member of blog

WordPress Trac noreply at wordpress.org
Sat Aug 29 13:46:13 UTC 2015


#33306: Only Query for author ID if user is member of blog
-------------------------+-------------------------------------
 Reporter:  sboisvert    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Query        |     Version:  4.3
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  multisite, performance
-------------------------+-------------------------------------

Comment (by boonebgorges):

 Thanks for the patch, sboisvert. This isn't really a multisite-specific
 issue - single-site WP can have Subscribers too - but it does tend to be
 more salient in a large network. So a more appropriate check than
 `is_multisite() && is_user_member_of_blog()` might be `current_user_can(
 'edit_posts' )`.

 The problem with this suggestion is that users can change roles (or, on
 your original patch, can be added to/removed from a blog). So an Author
 who publishes private posts who is then demoted to a Subscriber (or
 removed from the blog, in multisite) will no longer be able to see the
 private posts that she previously wrote. An edge case, to be sure.

 What do you think?

 See also #30911.

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


More information about the wp-trac mailing list