Skip to:
Content

bbPress.org

Changeset 4120


Ignore:
Timestamp:
07/25/2012 06:45:16 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Widgets:

  • Add phpdoc reminding that private/hidden forums are removed via bbp_pre_get_posts_exclude_forums.
  • Remove duplicate meta query on forums widget.
  • See #1891.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/bbp-includes/bbp-core-widgets.php

    r4039 r4120  
    379379        $title        = apply_filters( 'bbp_forum_widget_title', $instance['title'] );
    380380        $parent_forum = !empty( $instance['parent_forum'] ) ? $instance['parent_forum'] : '0';
     381
     382        // Note: private and hidden forums will be excluded via the
     383        // bbp_pre_get_posts_exclude_forums filter and function.
    381384        $widget_query = new WP_Query( array(
    382385            'post_parent'    => $parent_forum,
     
    384387            'posts_per_page' => get_option( '_bbp_forums_per_page', 50 ),
    385388            'orderby'        => 'menu_order',
    386             'order'          => 'ASC',
    387             'meta_query'     => array( bbp_exclude_forum_ids( 'meta_query' ) )
     389            'order'          => 'ASC'
    388390        ) );
    389391
     
    579581        }
    580582       
    581         // Query defaults
     583        // Note: private and hidden forums will be excluded via the
     584        // bbp_pre_get_posts_exclude_forums filter and function.
    582585        $widget_query = new WP_Query( $topics_query );
    583586
     
    726729        extract( $args );
    727730
    728         $title        = apply_filters( 'bbp_replies_widget_title', $instance['title'] );
    729         $max_shown    = !empty( $instance['max_shown'] ) ? $instance['max_shown']    : '5';
    730         $show_date    = !empty( $instance['show_date'] ) ? 'on'                      : false;
    731         $post_types   = !empty( $instance['post_type'] ) ? array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) : bbp_get_reply_post_type();
     731        $title      = apply_filters( 'bbp_replies_widget_title', $instance['title'] );
     732        $max_shown  = !empty( $instance['max_shown'] ) ? $instance['max_shown']    : '5';
     733        $show_date  = !empty( $instance['show_date'] ) ? 'on'                      : false;
     734        $post_types = !empty( $instance['post_type'] ) ? array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) : bbp_get_reply_post_type();
     735
     736        // Note: private and hidden forums will be excluded via the
     737        // bbp_pre_get_posts_exclude_forums filter and function.
    732738        $widget_query = new WP_Query( array(
    733739            'post_type'      => $post_types,
Note: See TracChangeset for help on using the changeset viewer.