Skip to:
Content

bbPress.org

Changeset 3930


Ignore:
Timestamp:
05/31/2012 06:07:19 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Only filter shortcode queries if query is not already set. Also, use correct filter names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-shortcodes.php

    r3758 r3930  
    312312        $this->unset_globals();
    313313
     314        // Filter the query
     315        if ( ! bbp_is_topic_archive() ) {
     316            add_filter( 'bbp_before_has_topics_parse_args', array( $this, 'display_topic_index_query' ) );
     317        }
     318
    314319        // Start output buffer
    315320        $this->start( 'bbp_topic_archive' );
    316 
    317         // Filter the query
    318         add_filter( 'bbp_pre_has_topics_query', array( $this, 'display_topic_index_query' ) );
    319321
    320322        // Output template
     
    369371        }
    370372
     373        // Filter the query
     374        if ( ! bbp_is_single_topic() ) {
     375            add_filter( 'bbp_before_has_replies_parse_args', array( $this, 'display_topic_query' ) );
     376        }
     377
    371378        // Start output buffer
    372379        $this->start( 'bbp_single_topic' );
     
    374381        // Check forum caps
    375382        if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
    376 
    377             // Filter the query
    378             add_filter( 'bbp_pre_has_replies_query', array( $this, 'display_topic_query' ) );
    379 
    380             // Output template
    381383            bbp_get_template_part( 'content', 'single-topic' );
    382384
     
    542544        $this->unset_globals();
    543545
    544         // Start output buffer
    545         $this->start( 'bbp_topics_of_tag' );
     546        // Filter the query
     547        if ( ! bbp_is_topic_tag() ) {
     548            add_filter( 'bbp_before_has_topics_parse_args', array( $this, 'display_topics_of_tag_query' ) );
     549        }
     550
     551        // Start output buffer
     552        $this->start( 'bbp_topic_tag' );
    546553
    547554        // Set passed attribute to $ag_id for clarity
    548555        bbpress()->current_topic_tag_id = $tag_id = $attr['id'];
    549 
    550         // Filter the query
    551         add_filter( 'bbp_pre_has_topics_query', array( $this, 'display_topics_of_tag_query' ) );
    552556
    553557        // Output template
     
    614618        $this->unset_globals();
    615619
    616         // Load the topic index
     620        // Load the view
    617621        bbp_view_query( $view_id );
    618622
     
    751755     */
    752756    public function display_topic_query( $args = array() ) {
    753 
    754757        $args['meta_query'] = array( array(
    755758            'key'     => '_bbp_topic_id',
     
    770773     */
    771774    public function display_topics_of_tag_query( $args = array() ) {
    772 
    773775        $args['tax_query'] = array( array(
    774776            'taxonomy' => bbp_get_topic_tag_tax_id(),
Note: See TracChangeset for help on using the changeset viewer.