WP_Query and BP
-
Hi,
I read here on forum about issue with BP, WP_Query and queried object,
but could not see if it’s going to be resolved.On BP components, main WP_Query is modified by BP.
Looks like BP replaces original queried object with BP contents
(member or group etc.).For example, on Members page
global $post is set asWP_Post Object ( [ID] => 0 [post_author] => 0 [post_date] => 0 [post_date_gmt] => 2015-03-19 11:48:56 [post_content] => [post_title] => Members [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => closed [post_password] => [post_name] => members [to_ping] => [pinged] => [post_modified] => 2015-03-19 11:48:56 [post_modified_gmt] => 2015-03-19 11:48:56 [post_content_filtered] => [post_parent] => 0 [guid] => http://localhost/bp/?page_id=5 [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [filter] => raw [is_404] => [is_page] => 1 [is_single] => [is_archive] => [is_tax] => )
Also, global $wp_query is altered
$wp_query->queried_object_id = 0
This happens on other pages too,
like single member page:WP_Post Object ( [ID] => 0 [post_author] => 0 [post_date] => 0 [post_date_gmt] => 0 [post_content] => [post_title] => admin [post_excerpt] => [post_status] => publish [comment_status] => closed [ping_status] => [post_password] => [post_name] => [to_ping] => [pinged] => [post_modified] => 0 [post_modified_gmt] => 0 [post_content_filtered] => [post_parent] => 0 [guid] => [menu_order] => 0 [post_type] => page [post_mime_type] => [comment_count] => 0 [filter] => raw [is_404] => [is_page] => 1 [is_single] => [is_archive] => [is_tax] => )
This causes various issues when you want to call actions associated with specific post/page.
Will this be resolved in future releases?
- The topic ‘WP_Query and BP’ is closed to new replies.