Changeset 9471 for trunk/src/bp-groups/bp-groups-functions.php
- Timestamp:
- 02/10/2015 02:49:16 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-groups/bp-groups-functions.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-functions.php
r9351 r9471 21 21 * @since BuddyPress (1.5.0) 22 22 * 23 * @global BuddyPress $bp The one true BuddyPress instance24 23 * @return bool True if set, False if empty 25 24 */ 26 25 function bp_groups_has_directory() { 27 global $bp;26 $bp = buddypress(); 28 27 29 28 return (bool) !empty( $bp->pages->groups->id ); … … 301 300 */ 302 301 function groups_is_valid_status( $status ) { 303 global $bp;302 $bp = buddypress(); 304 303 305 304 return in_array( $status, (array) $bp->groups->valid_status ); … … 313 312 */ 314 313 function groups_check_slug( $slug ) { 315 global $bp;314 $bp = buddypress(); 316 315 317 316 if ( 'wp' == substr( $slug, 0, 2 ) ) … … 365 364 */ 366 365 function groups_leave_group( $group_id, $user_id = 0 ) { 367 global $bp;368 366 369 367 if ( empty( $user_id ) ) … … 399 397 */ 400 398 function groups_join_group( $group_id, $user_id = 0 ) { 401 global $bp;402 399 403 400 if ( empty( $user_id ) ) … … 427 424 if ( !$new_member->save() ) 428 425 return false; 426 427 $bp = buddypress(); 429 428 430 429 if ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group || $group_id != $bp->groups->current_group->id ) … … 705 704 */ 706 705 function groups_get_current_group() { 707 global $bp; 708 709 $current_group = isset( $bp->groups->current_group ) ? $bp->groups->current_group : false; 706 $bp = buddypress(); 707 708 $current_group = isset( $bp->groups->current_group ) 709 ? $bp->groups->current_group 710 : false; 710 711 711 712 return apply_filters( 'groups_get_current_group', $current_group ); … … 722 723 */ 723 724 function groups_avatar_upload_dir( $group_id = 0 ) { 724 global $bp; 725 726 if ( !$group_id )727 $group_id = $bp->groups->current_group->id;725 726 if ( empty( $group_id ) ) { 727 $group_id = bp_get_current_group_id(); 728 } 728 729 729 730 $path = bp_core_avatar_upload_path() . '/group-avatars/' . $group_id; … … 810 811 */ 811 812 function groups_post_update( $args = '' ) { 812 global $bp;813 $bp = buddypress(); 813 814 814 815 $defaults = array(
Note: See TracChangeset
for help on using the changeset viewer.