[buddypress-trac] [BuddyPress Trac] #8641: Post thumbnail can never be fetched inside BP_Blogs_Blog::get_blog_extras()

buddypress-trac noreply at wordpress.org
Tue Feb 22 17:23:00 UTC 2022


#8641: Post thumbnail can never be fetched inside BP_Blogs_Blog::get_blog_extras()
--------------------------+-----------------------------
 Reporter:  boonebgorges  |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Blogs         |    Version:
 Severity:  normal        |   Keywords:  dev-feedback
--------------------------+-----------------------------
 In #4570 [6472], some logic was introduced to
 `BP_Blogs_Blog::get_blog_extras()` that fetches post thumbnails for use in
 the loop. It uses `get_post_thumbnail_id()` and `has_post_thumbnail()`.
 However, these are always used in the scope of the root blog, so they
 always reference the root blog and never the correct blog.

 In order to work, they need to be moved inside of a `switch_to_blog()`
 block.

 Perhaps additionally, it ought to be possible to disable this fetching.
 I've never used these images (never knew they were supposed to be there
 until today!!), and I'd prefer to avoid the queries. Perhaps we can have a
 filter `bp_blogs_fetch_latest_post_thumbnails` or something like that.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8641>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list