[buddypress-trac] [BuddyPress] #5021: Shortcode contents don't display in non-standard BP 1.7 themes

buddypress-trac noreply at wordpress.org
Wed May 29 06:48:03 UTC 2013

#5021: Shortcode contents don't display in non-standard BP 1.7 themes
 Reporter:  sensibleplugins         |       Owner:
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  1.8
Component:  Core                    |     Version:  1.7
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |

Comment (by r-a-y):

 JJJ, your comment (comment:5) made me think a bit more about when we
 should run BP's injection.

 For example, what if there is a `query_posts()` loop before our main page
 loop in a theme?  This could be a recent posts loop or a rotating slider,
 etc.  (I know what you're thinking.  Decent theme / plugin devs should
 always use a `WP_Query` post loop instead, but there are probably
 instances where `query_posts()` is being called.)

 Because we don't do other checks for this, BP's injection will happen in
 that loop as well as the main page loop.

 attachment:5021.4.patch checks to see if the current post loop has more
 than one post.  If there is more than one post, then our injection
 shouldn't happen for that loop.

 Also, I've added a marker after we've added our `add_filter(
 'the_content', 'bp_replace_the_content' )` hook because if we've already
 run our injection, then we have no need to do it again.

 I might be overthinking this, but it's better to be safe!

 Let me know what you think.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5021#comment:10>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list