[wp-trac] [WordPress Trac] #34312: On Multisite has_site_icon( $child_blog_id ) when checking from the root blog is false even if the child blog has a site icon
WordPress Trac
noreply at wordpress.org
Thu Oct 15 11:22:31 UTC 2015
#34312: On Multisite has_site_icon( $child_blog_id ) when checking from the root
blog is false even if the child blog has a site icon
--------------------------------+-----------------------------
Reporter: imath | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Networks and Sites | Version: trunk
Severity: normal | Keywords:
Focuses: multisite |
--------------------------------+-----------------------------
Hi,
First, i love the Site Icon, thanks a lot for this great new feature :)
Using it i've noticed there was an issue on multisite configs when trying
to check if a different blog had a Site Icon.
to reproduce:
On a multisite config, create a new blog ($new_blog_id), add a site icon
to it. Then come back on the root blog (or any other blogs actually) and
use `has_site_icon( $new_blog_id )`: it will be false.
I think the problem is due to the fact `wp_get_attachment_image_src()`
will look into the current blog instead of the requested blog.
Using `switch_to_blog()` instead of `get_blog_option()` is fixing the
issue for me.
I've attached a patch and a unit test to this ticket.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34312>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list