[buddypress-trac] [BuddyPress Trac] #6177: Improve representation of blog posts in the Activity Stream

buddypress-trac noreply at wordpress.org
Sat Mar 14 20:29:03 UTC 2015


#6177: Improve representation of blog posts in the Activity Stream
----------------------------------+-----------------------
 Reporter:  DJPaul                |       Owner:  DJPaul
     Type:  enhancement           |      Status:  accepted
 Priority:  normal                |   Milestone:  2.3
Component:  Component - Activity  |     Version:
 Severity:  normal                |  Resolution:
 Keywords:  has-patch             |
----------------------------------+-----------------------

Comment (by DJPaul):

 Also,

 > I would love to move the extract_images_from_galleries() and
 extract_images_from_featured_images() class method logic to the Blogs
 component

 This is a good question and shows you took time to read the code
 carefully, so thank you. :)

 Originally, I went to build the extractor as a static class, and
 galleries/featured images were in a child class
 ("BP_Media_Extractor_Post"). I had to give up on this due to inheritance
 issues with calling re-implemented methods (if we supported a later PHP
 version, Late Static Binding would have fixed this). It was also fiddly
 because then (we) would need to know when to use either one, and that's a
 bit fiddly. You can find some commits where I started re-factoring the
 code
 [https://github.com/paulgibbs/BuddyPress/commit/6c4e2f744cc1365347eefaef37a292e93f7ba65c
 here],
 [https://github.com/paulgibbs/BuddyPress/commit/a62fd2e8c8e3cde171df3a9eb6110eb065a258ac
 here],
 [https://github.com/paulgibbs/BuddyPress/commit/6967b80d127d277bbfe2e42f2d1d340c36f57192
 here], and
 [https://github.com/paulgibbs/BuddyPress/commit/aa7635c91376505ba3acfad891e86e4d7bd87d7c
 here].
 [https://github.com/paulgibbs/BuddyPress/commit/6c4e2f744cc1365347eefaef37a292e93f7ba65c
 This] was when I hit upon the current implementation.

 My biggest objection to moving the methods mentioned into the Blogs
 component, the potential complexity of that aside, is that I am not sure
 there is a good reason to require the Featured Image extractor to work
 only when the Blogs component is active. I see this as more of a general
 purpose library, like what we often seem to be building nowadays
 (suggestions, this, the attachments API).

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6177#comment:24>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list