Opened 5 years ago
Last modified 5 years ago
#48192 new enhancement
get_blogs_of_user not setting public parameter
Reported by: | tifosi | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | has-patch |
Focuses: | multisite | Cc: |
Description (last modified by )
Hello.
For multisite installations get_blogs_of_user uses get_sites to retrieve all multisite instances. This contains parameters such as archived, deleted, etc, and also the public parameter.
The get_blogs_of_user function iterates through the results of get_sites and sets the blogs array of blog objects. It matches and sets all parameters from get_sites, but omits the 'public' parameter, probably by oversight.
For example a blog from get_blogs_of_user:
stdClass Object ( [userblog_id] => 2 [blogname] => Site 2 [domain] => example.com [path] => /de/ [site_id] => 1 [siteurl] => http://example.com/de [archived] => 0 [mature] => 0 [spam] => 0 [deleted] => 0 [blog_id] => 2 [description] => 2 [language] => de_DE )
No way apart from using the 'get_blogs_of_user' filter to reiterate the sites and set the value.
Requires the public parameter to be set.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Makes sense. Seems pretty odd that the entire WP_Site object isn't just returned from
get_blogs_of_user()
instead of recreating with a new array though.All that's missing from the default properties are:
registered
,last_updated
,public
, andlang_id
. Should we just add all of those?