Changeset 5048
- Timestamp:
- 07/24/2013 11:39:25 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bbpress.php
r5047 r5048 839 839 */ 840 840 public function setup_current_user() { 841 $this->current_user = &wp_get_current_user();841 $this->current_user = wp_get_current_user(); 842 842 } 843 843 -
trunk/includes/common/classes.php
r4995 r5048 226 226 * @param array $args Uses 'selected' argument for selected post to set 227 227 * selected HTML attribute for option element. 228 * @param int $current_object_id 228 229 * @uses bbp_is_forum_category() To check if the forum is a category 229 230 * @uses current_user_can() To check if the current user can post in … … 233 234 * title, output, post, depth and args 234 235 */ 235 public function start_el( &$output, $_post, $depth , $args) {236 $pad = str_repeat( ' ', $depth * 3 );237 $output .= '<option class="level-' . $depth . '"';236 public function start_el( &$output, $_post, $depth = 0, $args = array(), $current_object_id = 0 ) { 237 $pad = str_repeat( ' ', (int) $depth * 3 ); 238 $output .= '<option class="level-' . (int) $depth . '"'; 238 239 239 240 // Disable the <option> if: … … 250 251 $output .= ' disabled="disabled" value=""'; 251 252 } else { 252 $output .= ' value="' . $_post->ID .'"' . selected( $args['selected'], $_post->ID, false );253 $output .= ' value="' . (int) $_post->ID .'"' . selected( $args['selected'], $_post->ID, false ); 253 254 } 254 255 … … 262 263 /** 263 264 * Create hierarchical list of bbPress replies. 264 * 265 * 265 266 * @package bbPress 266 267 * @subpackage Classes -
trunk/includes/extend/buddypress/groups.php
r5045 r5048 459 459 * @since bbPress (r3465) 460 460 */ 461 public function create_screen( ) {461 public function create_screen( $group_id = 0 ) { 462 462 463 463 // Bail if not looking at this screen … … 465 465 return false; 466 466 467 $checked = bp_get_new_group_enable_forum() || groups_get_groupmeta( bp_get_new_group_id(), 'forum_id' ); ?> 467 // Check for possibly empty group_id 468 if ( empty( $group_id ) ) { 469 $group_id = bp_get_new_group_id(); 470 } 471 472 $checked = bp_get_new_group_enable_forum() || groups_get_groupmeta( $group_id, 'forum_id' ); ?> 468 473 469 474 <h4><?php esc_html_e( 'Group Forum', 'bbpress' ); ?></h4> … … 476 481 477 482 <?php 478 479 // Verify intent480 wp_nonce_field( 'groups_create_save_' . $this->slug );481 483 } 482 484 … … 486 488 * @since bbPress (r3465) 487 489 */ 488 public function create_screen_save( ) {490 public function create_screen_save( $group_id = 0 ) { 489 491 490 492 // Nonce check … … 494 496 } 495 497 498 // Check for possibly empty group_id 499 if ( empty( $group_id ) ) { 500 $group_id = bp_get_new_group_id(); 501 } 502 496 503 $create_forum = !empty( $_POST['bbp-create-group-forum'] ) ? true : false; 497 504 $forum_id = 0; 498 $forum_ids = bbp_get_group_forum_ids( bp_get_new_group_id());505 $forum_ids = bbp_get_group_forum_ids( $group_id ); 499 506 500 507 if ( !empty( $forum_ids ) ) -
trunk/includes/extend/buddypress/loader.php
r5045 r5048 52 52 * Include BuddyPress classes and functions 53 53 */ 54 public function includes( ) {54 public function includes( $includes = array() ) { 55 55 56 56 // Helper BuddyPress functions … … 81 81 * @since bbPress (r3552) 82 82 */ 83 public function setup_globals( ) {83 public function setup_globals( $args = array() ) { 84 84 $bp = buddypress(); 85 85 … … 92 92 define( 'BP_FORUMS_SLUG', $this->id ); 93 93 94 // All globals for messaging component. 95 $globals = array( 96 'path' => BP_PLUGIN_DIR, 97 'slug' => BP_FORUMS_SLUG, 98 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG, 99 'has_directory' => false, 100 'notification_callback' => 'messages_format_notifications', 101 'search_string' => __( 'Search Forums...', 'bbpress' ), 102 ); 103 104 parent::setup_globals( $globals ); 94 // All arguments for forums component 95 $args = array( 96 'path' => BP_PLUGIN_DIR, 97 'slug' => BP_FORUMS_SLUG, 98 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG, 99 'has_directory' => false, 100 'search_string' => __( 'Search Forums...', 'bbpress' ), 101 ); 102 103 parent::setup_globals( $args ); 105 104 } 106 105 … … 158 157 * @since bbPress (r3552) 159 158 */ 160 public function setup_nav( ) {159 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 161 160 162 161 // Stop if there is no user displayed or logged in … … 165 164 166 165 // Define local variable(s) 167 $sub_nav = array();168 166 $user_domain = ''; 169 167 … … 243 241 * @since bbPress (r3552) 244 242 */ 245 public function setup_admin_bar() { 246 247 // Prevent debug notices 248 $wp_admin_nav = array(); 243 public function setup_admin_bar( $wp_admin_nav = array() ) { 249 244 250 245 // Menus for logged in user
Note: See TracChangeset
for help on using the changeset viewer.