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

buddypress-trac noreply at wordpress.org
Thu May 30 02:23:41 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):

 > I'm still not totally what the $wp_query->post_count check is intended
 to prevent. Can you give a specific example of what kind of thing it would

 I'm thinking mostly from a theme / widget sidebar perspective.

 If a widget added a post loop using `query_posts()` above the regular post
 loop like:
 http://pastebin.com/4yH2w2NZ (Twenty Twelve example)

 You will see that without the `post_count` check, theme compat would run
 in that loop.

 Also, I found that `the_excerpt()` seems to trigger theme compat as well
 due to the wp_trim_excerpt() function applying `the_content` filter.

 Like I said in comment:13, I might just be playing it too safe!

 > if ( in_the_loop() ) will return true whenever we're inside of any
 WP_Query loop.

 If you use a `query_posts()` loop, it will utilize the `$wp_query` global
 and [https://core.trac.wordpress.org/browser/tags/3.5.1/wp-
 includes/query.php#L746 in_the_loop()] will return true because it is
 reliant on the $wp_query global.  This is what I'm worried about.

 If you use a `WP_Query` post loop, it doesn't use the `$wp_query` global.
 `in_the_loop()` will return false and we're safe from these instances.

 Let me know if I'm not being clear enough!

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

More information about the buddypress-trac mailing list