PluginProbe
bbPress / 2.6.6
bbPress v2.6.6
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 2.2.2 All 71 releases
← All changes | includes/common/shortcodes.php +40 -60 trunk2.6.6 View file →
@@ -20,11 +20,9 @@
20 20
21 21 /** Vars ******************************************************************/
22 22
23 23 /**
24 - * Shortcode => function.
25 - *
26 - * @var array
24 + * @var array Shortcode => function
27 25 */
28 26 public $codes = array();
29 27
30 28 /** Functions *************************************************************/
@@ -48,59 +46,52 @@
48 46 * @access private
49 47 */
50 48 private function setup_globals() {
51 49
52 - // phpcs:disable PEAR.Functions.FunctionCallSignature.CloseBracketLine
53 -
54 50 // Setup the shortcodes
55 - $this->codes = apply_filters(
56 - 'bbp_shortcodes',
57 - array(
51 + $this->codes = apply_filters( 'bbp_shortcodes', array(
58 52
59 - /** Forums ****************************************************/
53 + /** Forums ********************************************************/
60 54
61 - 'bbp-forum-index' => array( $this, 'display_forum_index' ), // Forum Index
62 - 'bbp-forum-form' => array( $this, 'display_forum_form' ), // Topic form
63 - 'bbp-single-forum' => array( $this, 'display_forum' ), // Specific forum - pass an 'id' attribute
55 + 'bbp-forum-index' => array( $this, 'display_forum_index' ), // Forum Index
56 + 'bbp-forum-form' => array( $this, 'display_forum_form' ), // Topic form
57 + 'bbp-single-forum' => array( $this, 'display_forum' ), // Specific forum - pass an 'id' attribute
64 58
65 - /** Topics ****************************************************/
59 + /** Topics ********************************************************/
66 60
67 - 'bbp-topic-index' => array( $this, 'display_topic_index' ), // Topic index
68 - 'bbp-topic-form' => array( $this, 'display_topic_form' ), // Topic form
69 - 'bbp-single-topic' => array( $this, 'display_topic' ), // Specific topic - pass an 'id' attribute
61 + 'bbp-topic-index' => array( $this, 'display_topic_index' ), // Topic index
62 + 'bbp-topic-form' => array( $this, 'display_topic_form' ), // Topic form
63 + 'bbp-single-topic' => array( $this, 'display_topic' ), // Specific topic - pass an 'id' attribute
70 64
71 - /** Topic Tags ************************************************/
65 + /** Topic Tags ****************************************************/
72 66
73 - 'bbp-topic-tags' => array( $this, 'display_topic_tags' ), // All topic tags in a cloud
74 - 'bbp-single-tag' => array( $this, 'display_topics_of_tag' ), // Topics of Tag
67 + 'bbp-topic-tags' => array( $this, 'display_topic_tags' ), // All topic tags in a cloud
68 + 'bbp-single-tag' => array( $this, 'display_topics_of_tag' ), // Topics of Tag
75 69
76 - /** Replies ***************************************************/
70 + /** Replies *******************************************************/
77 71
78 - 'bbp-reply-form' => array( $this, 'display_reply_form' ), // Reply form
79 - 'bbp-single-reply' => array( $this, 'display_reply' ), // Specific reply - pass an 'id' attribute
72 + 'bbp-reply-form' => array( $this, 'display_reply_form' ), // Reply form
73 + 'bbp-single-reply' => array( $this, 'display_reply' ), // Specific reply - pass an 'id' attribute
80 74
81 - /** Views *****************************************************/
75 + /** Views *********************************************************/
82 76
83 - 'bbp-single-view' => array( $this, 'display_view' ), // Single view
77 + 'bbp-single-view' => array( $this, 'display_view' ), // Single view
84 78
85 - /** Search ****************************************************/
79 + /** Search ********************************************************/
86 80
87 - 'bbp-search-form' => array( $this, 'display_search_form' ), // Search form
88 - 'bbp-search' => array( $this, 'display_search' ), // Search
81 + 'bbp-search-form' => array( $this, 'display_search_form' ), // Search form
82 + 'bbp-search' => array( $this, 'display_search' ), // Search
89 83
90 - /** Account ***************************************************/
84 + /** Account *******************************************************/
91 85
92 - 'bbp-login' => array( $this, 'display_login' ), // Login
93 - 'bbp-register' => array( $this, 'display_register' ), // Register
94 - 'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password
86 + 'bbp-login' => array( $this, 'display_login' ), // Login
87 + 'bbp-register' => array( $this, 'display_register' ), // Register
88 + 'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password
95 89
96 - /** Others ****************************************************/
90 + /** Others *******************************************************/
97 91
98 - 'bbp-stats' => array( $this, 'display_stats' ), // Stats
99 - )
100 - );
101 -
102 - // phpcs:enable
92 + 'bbp-stats' => array( $this, 'display_stats' ), // Stats
93 + ) );
103 94 }
104 95
105 96 /**
106 97 * Register the bbPress shortcodes
@@ -180,16 +171,9 @@
180 171
181 172 // Return and flush the output buffer
182 173 $output = ob_get_clean();
183 174
184 - /**
185 - * Filters the contents of the output buffer before returning.
186 - *
187 - * @since 2.0.0 bbPress (r3079)
188 - *
189 - * @param string $output The contents of the output buffer.
190 - * @param string $query_name The query name used for this output.
191 - */
175 + // Filter & return
192 176 return apply_filters( 'bbp_display_shortcode', $output, $query_name );
193 177 }
194 178
195 179 /** Forum shortcodes ******************************************************/
@@ -521,16 +505,14 @@
521 505 // Start output buffer
522 506 $this->start( 'bbp_topic_tags' );
523 507
524 508 // Output the topic tags
525 - wp_tag_cloud(
526 - array(
527 - 'smallest' => 9,
528 - 'largest' => 38,
529 - 'number' => 80,
530 - 'taxonomy' => bbp_get_topic_tag_tax_id()
531 - )
532 - );
509 + wp_tag_cloud( array(
510 + 'smallest' => 9,
511 + 'largest' => 38,
512 + 'number' => 80,
513 + 'taxonomy' => bbp_get_topic_tag_tax_id()
514 + ) );
533 515
534 516 // Return contents of output buffer
535 517 return $this->end();
536 518 }
@@ -863,15 +845,13 @@
863 845 * @param array $args
864 846 * @return array
865 847 */
866 848 public function display_topics_of_tag_query( $args = array() ) {
867 - $args['tax_query'] = array(
868 - array(
869 - 'taxonomy' => bbp_get_topic_tag_tax_id(),
870 - 'field' => 'id',
871 - 'terms' => bbpress()->current_topic_tag_id
872 - )
873 - );
849 + $args['tax_query'] = array( array(
850 + 'taxonomy' => bbp_get_topic_tag_tax_id(),
851 + 'field' => 'id',
852 + 'terms' => bbpress()->current_topic_tag_id
853 + ) );
874 854
875 855 return $args;
876 856 }
877 857 }