Skip to:
Content

bbPress.org

Opened 3 years ago

Closed 2 years ago

#3071 closed defect (fixed)

Topic Tags don't have $wp_query state

Reported by: Cybr Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version: trunk
Component: Component - Topic Tags Keywords: commit
Cc:

Description

Topic Tags have an empty global $wp_query state after action parse_query.

Functions is_archive(), is_tax() and related all return false.
$wp_query->query_vars->taxonomy is correctly set, however.

Change History (5)

#1 @thebrandonallen
3 years ago

  • Component changed from General to Component - Topic Tags
  • Keywords reporter-feedback added

@Cybr
I can confirm that is_archive is false, but is_tax is true when visiting topic tag pages for me. Can you verify that is_tax is indeed false on topic tag pages for you?

#2 @Cybr
3 years ago

@thebrandonallen

Theme: Twenty Sixteen
Plugins: bbPress, that's it.
WP: 4.8-alpha-40139

Code:

<?php
add_action( 'wp_head', 'dump_wp_query' );
function dump_wp_query() {
        var_export( array(
                'is_single' => is_single(),
                'is_page' => is_page(),
                'is_singular' => is_singular(),
                'is_category' => is_category(),
                'is_tag' => is_tag(),
                'is_tax' => is_tax(),
                'is_post_type_archive' => is_post_type_archive(),
                'is_archive' => is_archive(),
                'is_author' => is_author(),
                'is_date' => is_date(),
                'is_year' => is_year(),
                'is_month' => is_month(),
                'is_day' => is_day(),
                'is_time' => is_time(),
                'is_search' => is_search(),
                'is_404' => is_404(),
                'is_attachment' => is_attachment(),
                'is_main_query' => is_main_query(),
                'is_bbpress' => is_bbpress(),
                'bbp_is_topic_tag' => bbp_is_topic_tag(),
        ) );
}

Output:

array (
  'is_single' => false,
  'is_page' => false,
  'is_singular' => false,
  'is_category' => false,
  'is_tag' => false,
  'is_tax' => false,
  'is_post_type_archive' => false,
  'is_archive' => false,
  'is_author' => false,
  'is_date' => false,
  'is_year' => false,
  'is_month' => false,
  'is_day' => false,
  'is_time' => false,
  'is_search' => false,
  'is_404' => false,
  'is_attachment' => false,
  'is_main_query' => true,
  'is_bbpress' => true,
  'bbp_is_topic_tag' => true,
)
Last edited 3 years ago by Cybr (previous) (diff)

#3 @netweb
3 years ago

I also am seeing is_tax returns true for both the Twenty Seventeen and Twenty Sixteen themes

#4 @johnjamesjacoby
2 years ago

  • Keywords commit added; reporter-feedback removed
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby

is_tax is correctly true. is_archive is incorrectly false.

#5 @johnjamesjacoby
2 years ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6453:

Topic Tags: set is_archive to true when viewing a topic tag archive.

Fixes #3071.

Note: See TracTickets for help on using tickets.