[wp-trac] [WordPress Trac] #37061: Use `get_sites()` in `get_blogs_of_user()`

WordPress Trac noreply at wordpress.org
Tue Sep 27 22:21:56 UTC 2016


#37061: Use `get_sites()` in `get_blogs_of_user()`
--------------------------------+-------------------------
 Reporter:  flixos90            |       Owner:  jeremyfelt
     Type:  enhancement         |      Status:  reviewing
 Priority:  normal              |   Milestone:  4.7
Component:  Networks and Sites  |     Version:  4.6
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  multisite
--------------------------------+-------------------------

Comment (by flixos90):

 Replying to [comment:10 jeremyfelt]:
 > I would normally want to avoid the churn of `blog` -> `site` naming in a
 change like this, but since we're modifying such a large part of the
 function and introducing a new loop through `$site_ids` and `$_sites` I
 think we're okay. Just noting. :)

 I was hoping you would say that for this case. :) Generally I'm aware of
 it.

 > * There should be an additional `@since 4.7.0` doc rather than using
 `@internal`.
 > * Two tests are failing for me in current trunk -
 `Tests_AdminBar::test_admin_bar_contains_correct_about_link_for_users_with_no_role_in_multisite`
 and
 `Tests_AdminBar::test_admin_bar_contains_correct_links_for_users_with_no_role_on_network`.
 I have not poked around further than that to see why.

 [attachment:37061.3.diff] has fixes for these; the latter were caused by
 missing a `! empty( $site_ids )` check which led to `get_sites()`
 returning all sites, which is something I still need to get used to, see
 #33341 :)

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


More information about the wp-trac mailing list