PluginProbe
bbPress / 2.6.17
bbPress v2.6.17
2.6.17 trunk 2.0 2.0-beta-1 2.0-beta-2b 2.0-beta-3 2.0-beta-3b 2.0-rc-2 2.0-rc-3 2.0-rc-4 2.0-rc-5 2.0.1 2.0.2 2.0.3 2.1 2.1-beta-1 2.1-rc1 2.1-rc2 2.1-rc3 2.1-rc4 2.1.1 2.1.2 2.1.3 2.2 2.2.1 All 72 releases
bbpress / includes / common / shortcodes.php

shortcodes.php in bbPress 2.6.17, at includes/common/shortcodes.php

877 lines 22.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * bbPress Shortcodes
5 *
6 * @package bbPress
7 * @subpackage Shortcodes
8 */
9
10 // Exit if accessed directly
11 defined( 'ABSPATH' ) || exit;
12
13 if ( ! class_exists( 'BBP_Shortcodes' ) ) :
14 /**
15 * bbPress Shortcode Class
16 *
17 * @since 2.0.0 bbPress (r3031)
18 */
19 class BBP_Shortcodes {
20
21 /** Vars ******************************************************************/
22
23 /**
24 * @var array Shortcode => function
25 */
26 public $codes = array();
27
28 /** Functions *************************************************************/
29
30 /**
31 * Add the register_shortcodes action to bbp_init
32 *
33 * @since 2.0.0 bbPress (r3031)
34 *
35 */
36 public function __construct() {
37 $this->setup_globals();
38 $this->add_shortcodes();
39 }
40
41 /**
42 * Shortcode globals
43 *
44 * @since 2.0.0 bbPress (r3143)
45 *
46 * @access private
47 */
48 private function setup_globals() {
49
50 // phpcs:disable PEAR.Functions.FunctionCallSignature.CloseBracketLine
51
52 // Setup the shortcodes
53 $this->codes = apply_filters(
54 'bbp_shortcodes',
55 array(
56
57 /** Forums ********************************************************/
58
59 'bbp-forum-index' => array( $this, 'display_forum_index' ), // Forum Index
60 'bbp-forum-form' => array( $this, 'display_forum_form' ), // Topic form
61 'bbp-single-forum' => array( $this, 'display_forum' ), // Specific forum - pass an 'id' attribute
62
63 /** Topics ********************************************************/
64
65 'bbp-topic-index' => array( $this, 'display_topic_index' ), // Topic index
66 'bbp-topic-form' => array( $this, 'display_topic_form' ), // Topic form
67 'bbp-single-topic' => array( $this, 'display_topic' ), // Specific topic - pass an 'id' attribute
68
69 /** Topic Tags ****************************************************/
70
71 'bbp-topic-tags' => array( $this, 'display_topic_tags' ), // All topic tags in a cloud
72 'bbp-single-tag' => array( $this, 'display_topics_of_tag' ), // Topics of Tag
73
74 /** Replies *******************************************************/
75
76 'bbp-reply-form' => array( $this, 'display_reply_form' ), // Reply form
77 'bbp-single-reply' => array( $this, 'display_reply' ), // Specific reply - pass an 'id' attribute
78
79 /** Views *********************************************************/
80
81 'bbp-single-view' => array( $this, 'display_view' ), // Single view
82
83 /** Search ********************************************************/
84
85 'bbp-search-form' => array( $this, 'display_search_form' ), // Search form
86 'bbp-search' => array( $this, 'display_search' ), // Search
87
88 /** Account *******************************************************/
89
90 'bbp-login' => array( $this, 'display_login' ), // Login
91 'bbp-register' => array( $this, 'display_register' ), // Register
92 'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password
93
94 /** Others *******************************************************/
95
96 'bbp-stats' => array( $this, 'display_stats' ), // Stats
97 )
98 );
99
100 // phpcs:enable
101 }
102
103 /**
104 * Register the bbPress shortcodes
105 *
106 * @since 2.0.0 bbPress (r3031)
107 */
108 private function add_shortcodes() {
109 foreach ( (array) $this->codes as $code => $function ) {
110 add_shortcode( $code, $function );
111 }
112 }
113
114 /**
115 * Unset some globals in the $bbp object that hold query related info
116 *
117 * @since 2.0.0 bbPress (r3034)
118 */
119 private function unset_globals() {
120 $bbp = bbpress();
121
122 // Unset global queries
123 $bbp->forum_query = new WP_Query();
124 $bbp->topic_query = new WP_Query();
125 $bbp->reply_query = new WP_Query();
126 $bbp->search_query = new WP_Query();
127
128 // Unset global ID's
129 $bbp->current_view_id = 0;
130 $bbp->current_forum_id = 0;
131 $bbp->current_topic_id = 0;
132 $bbp->current_reply_id = 0;
133 $bbp->current_topic_tag_id = 0;
134
135 // Reset the post data
136 wp_reset_postdata();
137 }
138
139 /** Output Buffers ********************************************************/
140
141 /**
142 * Start an output buffer.
143 *
144 * This is used to put the contents of the shortcode into a variable rather
145 * than outputting the HTML at run-time. This allows shortcodes to appear
146 * in the correct location in the_content() instead of when it's created.
147 *
148 * @since 2.0.0 bbPress (r3079)
149 *
150 * @param string $query_name
151 */
152 private function start( $query_name = '' ) {
153
154 // Set query name
155 bbp_set_query_name( $query_name );
156
157 // Start output buffer
158 ob_start();
159 }
160
161 /**
162 * Return the contents of the output buffer and flush its contents.
163 *
164 * @since 2.0.0 bbPress (r3079)
165 *
166 * @return string Contents of output buffer.
167 */
168 private function end() {
169
170 // Unset globals
171 $this->unset_globals();
172
173 // Get the query name, for filter
174 $query_name = bbp_get_query_name();
175
176 // Reset the query name
177 bbp_reset_query_name();
178
179 // Return and flush the output buffer
180 $output = ob_get_clean();
181
182 /**
183 * Filters the contents of the output buffer before returning.
184 *
185 * @since 2.0.0 bbPress (r3079)
186 *
187 * @param string $output The contents of the output buffer.
188 * @param string $query_name The query name used for this output.
189 */
190 return apply_filters( 'bbp_display_shortcode', $output, $query_name );
191 }
192
193 /** Forum shortcodes ******************************************************/
194
195 /**
196 * Display an index of all visible root level forums in an output buffer
197 * and return to ensure that post/page contents are displayed first.
198 *
199 * @since 2.0.0 bbPress (r3031)
200 *
201 * @return string
202 */
203 public function display_forum_index() {
204
205 // Unset globals
206 $this->unset_globals();
207
208 // Start output buffer
209 $this->start( 'bbp_forum_archive' );
210
211 bbp_get_template_part( 'content', 'archive-forum' );
212
213 // Return contents of output buffer
214 return $this->end();
215 }
216
217 /**
218 * Display the contents of a specific forum ID in an output buffer
219 * and return to ensure that post/page contents are displayed first.
220 *
221 * @since 2.0.0 bbPress (r3031)
222 *
223 * @param array $attr
224 * @param string $content
225 * @return string
226 */
227 public function display_forum( $attr, $content = '' ) {
228
229 // Sanity check required info
230 if ( ! empty( $content ) || ( empty( $attr['id'] ) || ! is_numeric( $attr['id'] ) ) ) {
231 return $content;
232 }
233
234 // Set passed attribute to $forum_id for clarity
235 $forum_id = bbpress()->current_forum_id = $attr['id'];
236
237 // Bail if ID passed is not a forum
238 if ( ! bbp_is_forum( $forum_id ) ) {
239 return $content;
240 }
241
242 // Start output buffer
243 $this->start( 'bbp_single_forum' );
244
245 // Check forum caps
246 if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
247 bbp_get_template_part( 'content', 'single-forum' );
248
249 // Forum is private and user does not have caps
250 } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
251 bbp_get_template_part( 'feedback', 'no-access' );
252 }
253
254 // Return contents of output buffer
255 return $this->end();
256 }
257
258 /**
259 * Display the forum form in an output buffer and return to ensure
260 * post/page contents are displayed first.
261 *
262 * @since 2.1.0 bbPress (r3566)
263 */
264 public function display_forum_form() {
265
266 // Start output buffer
267 $this->start( 'bbp_forum_form' );
268
269 // Output templates
270 bbp_get_template_part( 'form', 'forum' );
271
272 // Return contents of output buffer
273 return $this->end();
274 }
275
276 /** Topic shortcodes ******************************************************/
277
278 /**
279 * Display an index of all visible root level topics in an output buffer
280 * and return to ensure that post/page contents are displayed first.
281 *
282 * @since 2.0.0 bbPress (r3031)
283 *
284 * @return string
285 */
286 public function display_topic_index() {
287
288 // Unset globals
289 $this->unset_globals();
290
291 // Filter the query
292 if ( ! bbp_is_topic_archive() ) {
293 add_filter( 'bbp_before_has_topics_parse_args', array( $this, 'display_topic_index_query' ) );
294 }
295
296 // Start output buffer
297 $this->start( 'bbp_topic_archive' );
298
299 // Output template
300 bbp_get_template_part( 'content', 'archive-topic' );
301
302 // Return contents of output buffer
303 return $this->end();
304 }
305
306 /**
307 * Display the contents of a specific topic ID in an output buffer
308 * and return to ensure that post/page contents are displayed first.
309 *
310 * @since 2.0.0 bbPress (r3031)
311 *
312 * @param array $attr
313 * @param string $content
314 * @return string
315 */
316 public function display_topic( $attr, $content = '' ) {
317
318 // Sanity check required info
319 if ( ! empty( $content ) || ( empty( $attr['id'] ) || ! is_numeric( $attr['id'] ) ) ) {
320 return $content;
321 }
322
323 // Unset globals
324 $this->unset_globals();
325
326 // Set passed attribute to $forum_id for clarity
327 $topic_id = bbpress()->current_topic_id = $attr['id'];
328 $forum_id = bbp_get_topic_forum_id( $topic_id );
329
330 // Bail if ID passed is not a topic
331 if ( ! bbp_is_topic( $topic_id ) ) {
332 return $content;
333 }
334
335 // Reset the queries if not in theme compat
336 if ( ! bbp_is_theme_compat_active() ) {
337
338 $bbp = bbpress();
339
340 // Reset necessary forum_query attributes for topics loop to function
341 $bbp->forum_query->query_vars['post_type'] = bbp_get_forum_post_type();
342 $bbp->forum_query->in_the_loop = true;
343 $bbp->forum_query->post = get_post( $forum_id );
344
345 // Reset necessary topic_query attributes for topics loop to function
346 $bbp->topic_query->query_vars['post_type'] = bbp_get_topic_post_type();
347 $bbp->topic_query->in_the_loop = true;
348 $bbp->topic_query->post = get_post( $topic_id );
349 }
350
351 // Start output buffer
352 $this->start( 'bbp_single_topic' );
353
354 // Check forum caps
355 if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
356 bbp_get_template_part( 'content', 'single-topic' );
357
358 // Forum is private and user does not have caps
359 } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
360 bbp_get_template_part( 'feedback', 'no-access' );
361 }
362
363 // Return contents of output buffer
364 return $this->end();
365 }
366
367 /**
368 * Display the topic form in an output buffer and return to ensure
369 * post/page contents are displayed first.
370 *
371 * Supports 'forum_id' attribute to display the topic form for a particular
372 * forum. This currently has styling issues from not being wrapped in
373 * <div id="bbpress-forums" class="bbpress-wrapper"></div> which will need to be sorted out later.
374 *
375 * @since 2.0.0 bbPress (r3031)
376 *
377 * @param array $attr
378 * @param string $content
379 * @return string
380 */
381 public function display_topic_form( $attr = array(), $content = '' ) {
382
383 // Sanity check supplied info
384 if ( ! empty( $content ) || ( ! empty( $attr['forum_id'] ) && ( ! is_numeric( $attr['forum_id'] ) || ! bbp_is_forum( $attr['forum_id'] ) ) ) ) {
385 return $content;
386 }
387
388 // Unset globals
389 $this->unset_globals();
390
391 // If forum id is set, use the 'bbp_single_forum' query name
392 if ( ! empty( $attr['forum_id'] ) ) {
393
394 // Set the global current_forum_id for future requests
395 bbpress()->current_forum_id = $forum_id = bbp_get_forum_id( $attr['forum_id'] );
396
397 // Start output buffer
398 $this->start( 'bbp_single_forum' );
399
400 // No forum id was passed
401 } else {
402
403 // Set the $forum_id variable to satisfy checks below
404 $forum_id = 0;
405
406 // Start output buffer
407 $this->start( 'bbp_topic_form' );
408 }
409
410 // If the forum id is set, check forum caps else display normal topic form
411 if ( empty( $forum_id ) || bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
412 bbp_get_template_part( 'form', 'topic' );
413
414 // Forum is private and user does not have caps
415 } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
416 bbp_get_template_part( 'feedback', 'no-access' );
417 }
418
419 // Return contents of output buffer
420 return $this->end();
421 }
422
423 /** Replies ***************************************************************/
424
425 /**
426 * Display the contents of a specific reply ID in an output buffer
427 * and return to ensure that post/page contents are displayed first.
428 *
429 * @since 2.0.0 bbPress (r3031)
430 *
431 * @param array $attr
432 * @param string $content
433 * @return string
434 */
435 public function display_reply( $attr, $content = '' ) {
436
437 // Sanity check required info
438 if ( ! empty( $content ) || ( empty( $attr['id'] ) || ! is_numeric( $attr['id'] ) ) ) {
439 return $content;
440 }
441
442 // Unset globals
443 $this->unset_globals();
444
445 // Set passed attribute to $reply_id for clarity
446 $reply_id = bbpress()->current_reply_id = $attr['id'];
447 $forum_id = bbp_get_reply_forum_id( $reply_id );
448
449 // Bail if ID passed is not a reply
450 if ( ! bbp_is_reply( $reply_id ) ) {
451 return $content;
452 }
453
454 // Reset the queries if not in theme compat
455 if ( ! bbp_is_theme_compat_active() ) {
456
457 $bbp = bbpress();
458
459 // Reset necessary forum_query attributes for reply loop to function
460 $bbp->forum_query->query_vars['post_type'] = bbp_get_forum_post_type();
461 $bbp->forum_query->in_the_loop = true;
462 $bbp->forum_query->post = get_post( $forum_id );
463
464 // Reset necessary reply_query attributes for reply loop to function
465 $bbp->reply_query->query_vars['post_type'] = bbp_get_reply_post_type();
466 $bbp->reply_query->in_the_loop = true;
467 $bbp->reply_query->post = get_post( $reply_id );
468 }
469
470 // Start output buffer
471 $this->start( 'bbp_single_reply' );
472
473 // Check forum caps
474 if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) {
475 bbp_get_template_part( 'content', 'single-reply' );
476
477 // Forum is private and user does not have caps
478 } elseif ( bbp_is_forum_private( $forum_id, false ) ) {
479 bbp_get_template_part( 'feedback', 'no-access' );
480 }
481
482 // Return contents of output buffer
483 return $this->end();
484 }
485
486 /**
487 * Display the reply form in an output buffer and return to ensure
488 * post/page contents are displayed first.
489 *
490 * @since 2.0.0 bbPress (r3031)
491 */
492 public function display_reply_form() {
493
494 // Start output buffer
495 $this->start( 'bbp_reply_form' );
496
497 // Output templates
498 bbp_get_template_part( 'form', 'reply' );
499
500 // Return contents of output buffer
501 return $this->end();
502 }
503
504 /** Topic Tags ************************************************************/
505
506 /**
507 * Display a tag cloud of all topic tags in an output buffer and return to
508 * ensure that post/page contents are displayed first.
509 *
510 * @since 2.0.0 bbPress (r3110)
511 *
512 * @return string
513 */
514 public function display_topic_tags() {
515
516 // Unset globals
517 $this->unset_globals();
518
519 // Start output buffer
520 $this->start( 'bbp_topic_tags' );
521
522 // Output the topic tags
523 wp_tag_cloud(
524 array(
525 'smallest' => 9,
526 'largest' => 38,
527 'number' => 80,
528 'taxonomy' => bbp_get_topic_tag_tax_id()
529 )
530 );
531
532 // Return contents of output buffer
533 return $this->end();
534 }
535
536 /**
537 * Display the contents of a specific topic tag in an output buffer
538 * and return to ensure that post/page contents are displayed first.
539 *
540 * @since 2.0.0 bbPress (r3110)
541 *
542 * @param array $attr
543 * @param string $content
544 * @return string
545 */
546 public function display_topics_of_tag( $attr, $content = '' ) {
547
548 // Sanity check required info
549 if ( ! empty( $content ) || ( empty( $attr['id'] ) || ! is_numeric( $attr['id'] ) ) ) {
550 return $content;
551 }
552
553 // Unset globals
554 $this->unset_globals();
555
556 // Filter the query
557 if ( ! bbp_is_topic_tag() ) {
558 add_filter( 'bbp_before_has_topics_parse_args', array( $this, 'display_topics_of_tag_query' ) );
559 }
560
561 // Start output buffer
562 $this->start( 'bbp_topic_tag' );
563
564 // Set passed attribute to $ag_id for clarity
565 bbpress()->current_topic_tag_id = $tag_id = $attr['id'];
566
567 // Output template
568 bbp_get_template_part( 'content', 'archive-topic' );
569
570 // Return contents of output buffer
571 return $this->end();
572 }
573
574 /**
575 * Display the contents of a specific topic tag in an output buffer
576 * and return to ensure that post/page contents are displayed first.
577 *
578 * @since 2.0.0 bbPress (r3346)
579 *
580 * @return string
581 */
582 public function display_topic_tag_form() {
583
584 // Unset globals
585 $this->unset_globals();
586
587 // Start output buffer
588 $this->start( 'bbp_topic_tag_edit' );
589
590 // Output template
591 bbp_get_template_part( 'content', 'topic-tag-edit' );
592
593 // Return contents of output buffer
594 return $this->end();
595 }
596
597 /** Views *****************************************************************/
598
599 /**
600 * Display the contents of a specific view in an output buffer and return to
601 * ensure that post/page contents are displayed first.
602 *
603 * @since 2.0.0 bbPress (r3031)
604 *
605 * @param array $attr
606 * @param string $content
607 * @return string
608 */
609 public function display_view( $attr, $content = '' ) {
610
611 // Sanity check required info
612 if ( empty( $attr['id'] ) ) {
613 return $content;
614 }
615
616 // Set passed attribute to $view_id for clarity
617 $view_id = $attr['id'];
618
619 // Start output buffer
620 $this->start( 'bbp_single_view' );
621
622 // Unset globals
623 $this->unset_globals();
624
625 // Set the current view ID
626 bbpress()->current_view_id = $view_id;
627
628 // Load the view
629 bbp_view_query( $view_id );
630
631 // Output template
632 bbp_get_template_part( 'content', 'single-view' );
633
634 // Return contents of output buffer
635 return $this->end();
636 }
637
638 /** Search ****************************************************************/
639
640 /**
641 * Display the search form in an output buffer and return to ensure
642 * post/page contents are displayed first.
643 *
644 * @since 2.3.0 bbPress (r4585)
645 */
646 public function display_search_form() {
647
648 // Bail if search is disabled
649 if ( ! bbp_allow_search() ) {
650 return;
651 }
652
653 // Start output buffer
654 $this->start( 'bbp_search_form' );
655
656 // Output templates
657 bbp_get_template_part( 'form', 'search' );
658
659 // Return contents of output buffer
660 return $this->end();
661 }
662
663 /**
664 * Display the contents of search results in an output buffer and return to
665 * ensure that post/page contents are displayed first.
666 *
667 * @since 2.3.0 bbPress (r4579)
668 *
669 * @param array $attr
670 * @param string $content
671 */
672 public function display_search( $attr, $content = '' ) {
673
674 // Sanity check required info
675 if ( ! empty( $content ) ) {
676 return $content;
677 }
678
679 // Bail if search is disabled
680 if ( ! bbp_allow_search() ) {
681 return;
682 }
683
684 // Trim search attribute if it's set
685 if ( isset( $attr['search'] ) ) {
686 $attr['search'] = trim( $attr['search'] );
687 }
688
689 // Set passed attribute to $search_terms for clarity
690 $search_terms = empty( $attr['search'] )
691 ? bbp_get_search_terms()
692 : $attr['search'];
693
694 // Get the rewrite ID (one time, to avoid repeated calls)
695 $rewrite_id = bbp_get_search_rewrite_id();
696
697 // Unset globals
698 $this->unset_globals();
699
700 // Set terms for query
701 set_query_var( $rewrite_id, $search_terms );
702
703 // Start output buffer
704 $this->start( $rewrite_id );
705
706 // Output template
707 bbp_get_template_part( 'content', 'search' );
708
709 // Return contents of output buffer
710 return $this->end();
711 }
712
713 /** Account ***************************************************************/
714
715 /**
716 * Display a login form
717 *
718 * @since 2.0.0 bbPress (r3302)
719 *
720 * @return string
721 */
722 public function display_login() {
723
724 // Unset globals
725 $this->unset_globals();
726
727 // Start output buffer
728 $this->start( 'bbp_login' );
729
730 // Output templates
731 if ( ! is_user_logged_in() ) {
732 bbp_get_template_part( 'form', 'user-login' );
733 } else {
734 bbp_get_template_part( 'feedback', 'logged-in' );
735 }
736
737 // Return contents of output buffer
738 return $this->end();
739 }
740
741 /**
742 * Display a register form
743 *
744 * @since 2.0.0 bbPress (r3302)
745 *
746 * @return string
747 */
748 public function display_register() {
749
750 // Unset globals
751 $this->unset_globals();
752
753 // Start output buffer
754 $this->start( 'bbp_register' );
755
756 // Output templates
757 if ( ! is_user_logged_in() ) {
758 bbp_get_template_part( 'form', 'user-register' );
759 } else {
760 bbp_get_template_part( 'feedback', 'logged-in' );
761 }
762
763 // Return contents of output buffer
764 return $this->end();
765 }
766
767 /**
768 * Display a lost password form
769 *
770 * @since 2.0.0 bbPress (r3302)
771 *
772 * @return string
773 */
774 public function display_lost_pass() {
775
776 // Unset globals
777 $this->unset_globals();
778
779 // Start output buffer
780 $this->start( 'bbp_lost_pass' );
781
782 // Output templates
783 if ( ! is_user_logged_in() ) {
784 bbp_get_template_part( 'form', 'user-lost-pass' );
785 } else {
786 bbp_get_template_part( 'feedback', 'logged-in' );
787 }
788
789 // Return contents of output buffer
790 return $this->end();
791 }
792
793 /** Other *****************************************************************/
794
795 /**
796 * Display forum statistics
797 *
798 * @since 2.3.0 bbPress (r4509)
799 *
800 * @return string
801 */
802 public function display_stats() {
803
804 // Unset globals
805 $this->unset_globals();
806
807 // Start output buffer
808 $this->start();
809
810 // Output statistics
811 bbp_get_template_part( 'content', 'statistics' );
812
813 // Return contents of output buffer
814 return $this->end();
815 }
816
817 /**
818 * Display a breadcrumb
819 *
820 * @since 2.0.0 bbPress (r3302)
821 *
822 * @return string
823 */
824 public function display_breadcrumb() {
825
826 // Unset globals
827 $this->unset_globals();
828
829 // Start output buffer
830 $this->start();
831
832 // Output breadcrumb
833 bbp_breadcrumb();
834
835 // Return contents of output buffer
836 return $this->end();
837 }
838
839 /** Query Filters *********************************************************/
840
841 /**
842 * Filter the query for the topic index
843 *
844 * @since 2.1.0 bbPress (r3637)
845 *
846 * @param array $args
847 * @return array
848 */
849 public function display_topic_index_query( $args = array() ) {
850 $args['author'] = 0;
851 $args['show_stickies'] = true;
852 $args['order'] = 'DESC';
853 return $args;
854 }
855
856 /**
857 * Filter the query for topic tags
858 *
859 * @since 2.1.0 bbPress (r3637)
860 *
861 * @param array $args
862 * @return array
863 */
864 public function display_topics_of_tag_query( $args = array() ) {
865 $args['tax_query'] = array(
866 array(
867 'taxonomy' => bbp_get_topic_tag_tax_id(),
868 'field' => 'id',
869 'terms' => bbpress()->current_topic_tag_id
870 )
871 );
872
873 return $args;
874 }
875 }
876 endif;
877