diff --git a/bbPress/shortcodes.php b/bbPress/shortcodes.php
index 47a7b82..e2fc8e9 100644
|
a
|
b
|
class BBP_Shortcodes { |
| 55 | 55 | |
| 56 | 56 | /** Forums ********************************************************/ |
| 57 | 57 | |
| 58 | | 'bbp-forum-index' => array( $this, 'display_forum_index' ), // Forum Index |
| 59 | | 'bbp-forum-form' => array( $this, 'display_forum_form' ), // Topic form |
| 60 | | 'bbp-single-forum' => array( $this, 'display_forum' ), // Specific forum - pass an 'id' attribute |
| | 58 | 'bbp-forum-index' => array( $this, 'display_forum_index' ), // Forum Index |
| | 59 | 'bbp-forum-form' => array( $this, 'display_forum_form' ), // Topic form |
| | 60 | 'bbp-single-forum' => array( $this, 'display_forum' ), // Specific forum - pass an 'id' attribute |
| 61 | 61 | |
| 62 | 62 | /** Topics ********************************************************/ |
| 63 | 63 | |
| 64 | | 'bbp-topic-index' => array( $this, 'display_topic_index' ), // Topic index |
| 65 | | 'bbp-topic-form' => array( $this, 'display_topic_form' ), // Topic form |
| 66 | | 'bbp-single-topic' => array( $this, 'display_topic' ), // Specific topic - pass an 'id' attribute |
| | 64 | 'bbp-topic-index' => array( $this, 'display_topic_index' ), // Topic index |
| | 65 | 'bbp-topic-form' => array( $this, 'display_topic_form' ), // Topic form |
| | 66 | 'bbp-single-topic' => array( $this, 'display_topic' ), // Specific topic - pass an 'id' attribute |
| | 67 | 'bbp-topic-in-forum' => array( $this, 'display_topic_in_forum' ), // New topic in specific forum - pass an 'id' attribute |
| 67 | 68 | |
| 68 | 69 | /** Topic Tags ****************************************************/ |
| 69 | 70 | |
| 70 | | 'bbp-topic-tags' => array( $this, 'display_topic_tags' ), // All topic tags in a cloud |
| 71 | | 'bbp-single-tag' => array( $this, 'display_topics_of_tag' ), // Topics of Tag |
| | 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 |
| 72 | 73 | |
| 73 | 74 | /** Replies *******************************************************/ |
| 74 | 75 | |
| 75 | | 'bbp-reply-form' => array( $this, 'display_reply_form' ), // Reply form |
| 76 | | 'bbp-single-reply' => array( $this, 'display_reply' ), // Specific reply - pass an 'id' attribute |
| | 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 |
| 77 | 78 | |
| 78 | 79 | /** Views *********************************************************/ |
| 79 | 80 | |
| 80 | | 'bbp-single-view' => array( $this, 'display_view' ), // Single view |
| | 81 | 'bbp-single-view' => array( $this, 'display_view' ), // Single view |
| 81 | 82 | |
| 82 | 83 | /** Account *******************************************************/ |
| 83 | 84 | |
| 84 | | 'bbp-login' => array( $this, 'display_login' ), // Login |
| 85 | | 'bbp-register' => array( $this, 'display_register' ), // Register |
| 86 | | 'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password |
| | 85 | 'bbp-login' => array( $this, 'display_login' ), // Login |
| | 86 | 'bbp-register' => array( $this, 'display_register' ), // Register |
| | 87 | 'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password |
| 87 | 88 | ) ); |
| 88 | 89 | } |
| 89 | 90 | |
| … |
… |
class BBP_Shortcodes { |
| 383 | 384 | return $this->end(); |
| 384 | 385 | } |
| 385 | 386 | |
| | 387 | /** |
| | 388 | * Display the new topic form for a specific forum ID in an output buffer |
| | 389 | * and return to ensure post/page contents are displayed first. |
| | 390 | * |
| | 391 | * @since bbPress (r3031) |
| | 392 | * |
| | 393 | * @uses get_template_part() |
| | 394 | */ |
| | 395 | public function display_topic_in_forum( $attr, $content = '' ) { |
| | 396 | |
| | 397 | // Sanity check required info |
| | 398 | if ( !empty( $content ) || ( empty( $attr['id'] ) || !is_numeric( $attr['id'] ) ) ) |
| | 399 | return $content; |
| | 400 | |
| | 401 | // Unset globals |
| | 402 | $this->unset_globals(); |
| | 403 | |
| | 404 | // Set passed attribute to $forum_id for clarity |
| | 405 | $forum_id = bbpress()->current_forum_id = $attr['id']; |
| | 406 | |
| | 407 | // Bail if ID passed is not a forum |
| | 408 | if ( !bbp_is_forum( $forum_id ) ) |
| | 409 | return $content; |
| | 410 | |
| | 411 | // Start output buffer |
| | 412 | $this->start( 'bbp_topic_in_forum' ); |
| | 413 | |
| | 414 | // Check forum caps - Also need to make sure forum_id is not a category |
| | 415 | if ( bbp_user_can_view_forum( array( 'forum_id' => $forum_id ) ) ) { |
| | 416 | bbp_get_template_part( 'form', 'topic' ); |
| | 417 | |
| | 418 | // Forum is private and user does not have caps |
| | 419 | } elseif ( bbp_is_forum_private( $forum_id, false ) ) { |
| | 420 | bbp_get_template_part( 'feedback', 'no-access' ); |
| | 421 | } |
| | 422 | |
| | 423 | // Return contents of output buffer |
| | 424 | return $this->end(); |
| | 425 | } |
| | 426 | |
| 386 | 427 | /** Replies ***************************************************************/ |
| 387 | 428 | |
| 388 | 429 | /** |
| … |
… |
class BBP_Shortcodes { |
| 675 | 716 | return $this->end(); |
| 676 | 717 | } |
| 677 | 718 | |
| 678 | | /** Other *****************************************************************/ |
| | 719 | /** Breadcrumb ************************************************************/ |
| 679 | 720 | |
| 680 | 721 | /** |
| 681 | 722 | * Display a breadcrumb |