Changeset 3829
- Timestamp:
- 03/31/2012 07:22:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-core-classes.php
r3828 r3829 53 53 var $current_id; 54 54 55 56 /** Methods ***************************************************************/ 55 57 56 58 /** … … 69 71 * @uses BBP_Component::setup_actions() Setup the hooks and actions 70 72 */ 71 function BBP_Component( $args = '' ) {73 public function __construct( $args = '' ) { 72 74 if ( empty( $args ) ) 73 75 return; … … 87 89 * @uses apply_filters() Calls 'bbp_{@link BBP_Component::name}_slug' 88 90 */ 89 function setup_globals( $args = '' ) {91 private function setup_globals( $args = '' ) { 90 92 $this->name = $args['name']; 91 93 $this->id = apply_filters( 'bbp_' . $this->name . '_id', $args['id'] ); … … 101 103 * @uses do_action() Calls 'bbp_{@link BBP_Component::name}includes' 102 104 */ 103 function includes() {105 private function includes() { 104 106 do_action( 'bbp_' . $this->name . 'includes' ); 105 107 } … … 115 117 * 'bbp_{@link BBP_Component::name}setup_actions' 116 118 */ 117 function setup_actions() {119 private function setup_actions() { 118 120 add_action( 'bbp_register_post_types', array( $this, 'register_post_types' ), 10, 2 ); // Register post types 119 121 add_action( 'bbp_register_taxonomies', array( $this, 'register_taxonomies' ), 10, 2 ); // Register taxonomies … … 132 134 * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_register_post_types' 133 135 */ 134 function register_post_types() {136 public function register_post_types() { 135 137 do_action( 'bbp_' . $this->name . '_register_post_types' ); 136 138 } … … 143 145 * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_register_taxonomies' 144 146 */ 145 function register_taxonomies() {147 public function register_taxonomies() { 146 148 do_action( 'bbp_' . $this->name . '_register_taxonomies' ); 147 149 } … … 154 156 * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_add_rewrite_tags' 155 157 */ 156 function add_rewrite_tags() {158 public function add_rewrite_tags() { 157 159 do_action( 'bbp_' . $this->name . '_add_rewrite_tags' ); 158 160 } … … 165 167 * @uses do_action() Calls 'bbp_{@link BBP_Component::name}_generate_rewrite_rules' 166 168 */ 167 function generate_rewrite_rules( $wp_rewrite ) {169 public function generate_rewrite_rules( $wp_rewrite ) { 168 170 do_action_ref_array( 'bbp_' . $this->name . '_generate_rewrite_rules', $wp_rewrite ); 169 171 } … … 183 185 */ 184 186 class BBP_Walker_Forum extends Walker { 187 185 188 /** 186 189 * @see Walker::$tree_type … … 201 204 var $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' ); 202 205 206 /** Methods ***************************************************************/ 207 203 208 /** 204 209 * Set the tree_type … … 206 211 * @since bbPress (r2514) 207 212 */ 208 function BBP_Walker_Forum() {213 public function __construct() { 209 214 $this->tree_type = bbp_get_forum_post_type(); 210 215 } … … 219 224 * @param int $depth Depth of page. Used for padding. 220 225 */ 221 function start_lvl( &$output, $depth ) {226 public function start_lvl( &$output, $depth ) { 222 227 $indent = str_repeat( "\t", $depth ); 223 228 $output .= "\n$indent<ul class='children'>\n"; … … 233 238 * @param int $depth Depth of page. Used for padding. 234 239 */ 235 function end_lvl( &$output, $depth ) {240 public function end_lvl( &$output, $depth ) { 236 241 $indent = str_repeat( "\t", $depth ); 237 242 $output .= "$indent</ul>\n"; … … 250 255 * @param array $args 251 256 */ 252 function start_el( &$output, $forum, $depth, $args, $current_forum ) {257 public function start_el( &$output, $forum, $depth, $args, $current_forum ) { 253 258 254 259 $indent = $depth ? str_repeat( "\t", $depth ) : ''; … … 291 296 * @param int $depth Depth of page. Not Used. 292 297 */ 293 function end_el( &$output, $forum, $depth ) {298 public function end_el( &$output, $forum, $depth ) { 294 299 $output .= "</li>\n"; 295 300 } … … 306 311 */ 307 312 class BBP_Walker_Dropdown extends Walker { 313 308 314 /** 309 315 * @see Walker::$tree_type … … 324 330 var $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' ); 325 331 332 /** Methods ***************************************************************/ 333 326 334 /** 327 335 * Set the tree_type … … 329 337 * @since bbPress (r2746) 330 338 */ 331 function BBP_Walker_Dropdown() {339 public function __construct() { 332 340 $this->tree_type = bbp_get_forum_post_type(); 333 341 } … … 352 360 * title, output, post, depth and args 353 361 */ 354 function start_el( &$output, $_post, $depth, $args ) {362 public function start_el( &$output, $_post, $depth, $args ) { 355 363 $pad = str_repeat( ' ', $depth * 3 ); 356 364 $output .= "\t<option class=\"level-$depth\"";
Note: See TracChangeset
for help on using the changeset viewer.