Changeset 9471 for trunk/src/bp-groups/bp-groups-template.php
- Timestamp:
- 02/10/2015 02:49:16 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-template.php
r9466 r9471 1500 1500 */ 1501 1501 function bp_group_search_form() { 1502 global $bp;1503 1502 1504 1503 $action = bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/search/'; … … 1597 1596 */ 1598 1597 function bp_groups_auto_join() { 1599 global $bp; 1600 1601 return apply_filters( 'bp_groups_auto_join', (bool)$bp->groups->auto_join ); 1598 return apply_filters( 'bp_groups_auto_join', (bool) buddypress()->groups->auto_join ); 1602 1599 } 1603 1600 … … 1861 1858 */ 1862 1859 function bp_group_get_invite_status( $group_id = false ) { 1863 global $ bp, $groups_template;1860 global $groups_template; 1864 1861 1865 1862 if ( !$group_id ) { 1863 $bp = buddypress(); 1864 1866 1865 if ( isset( $bp->groups->current_group->id ) ) { 1867 1866 // Default to the current group first … … 2558 2557 */ 2559 2558 function bp_get_group_accept_invite_link( $group = false ) { 2560 global $groups_template , $bp;2559 global $groups_template; 2561 2560 2562 2561 if ( empty( $group ) ) 2563 2562 $group =& $groups_template->group; 2563 2564 $bp = buddypress(); 2564 2565 2565 2566 return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/accept/' . $group->id ), 'groups_accept_invite' ) ); … … 2580 2581 */ 2581 2582 function bp_get_group_reject_invite_link( $group = false ) { 2582 global $groups_template , $bp;2583 global $groups_template; 2583 2584 2584 2585 if ( empty( $group ) ) 2585 2586 $group =& $groups_template->group; 2587 2588 $bp = buddypress(); 2586 2589 2587 2590 return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/invites/reject/' . $group->id ), 'groups_reject_invite' ) ); … … 3623 3626 3624 3627 function bp_group_creation_tabs() { 3625 global $bp;3628 $bp = buddypress(); 3626 3629 3627 3630 if ( !is_array( $bp->groups->group_creation_steps ) ) … … 3648 3651 3649 3652 function bp_group_creation_stage_title() { 3650 global $bp;3653 $bp = buddypress(); 3651 3654 3652 3655 echo apply_filters( 'bp_group_creation_stage_title', '<span>— ' . $bp->groups->group_creation_steps[bp_get_groups_current_create_step()]['name'] . '</span>' ); … … 3657 3660 } 3658 3661 function bp_get_group_creation_form_action() { 3659 global $bp;3662 $bp = buddypress(); 3660 3663 3661 3664 if ( !bp_action_variable( 1 ) ) { … … 3668 3671 3669 3672 function bp_is_group_creation_step( $step_slug ) { 3670 global $bp;3671 3673 3672 3674 /* Make sure we are in the groups component */ 3673 3675 if ( !bp_is_groups_component() || !bp_is_current_action( 'create' ) ) 3674 3676 return false; 3677 3678 $bp = buddypress(); 3675 3679 3676 3680 /* If this the first step, we can just accept and return true */ … … 3693 3697 3694 3698 function bp_is_group_creation_step_complete( $step_slugs ) { 3695 global $bp;3699 $bp = buddypress(); 3696 3700 3697 3701 if ( !isset( $bp->groups->completed_create_steps ) ) … … 3715 3719 3716 3720 function bp_are_previous_group_creation_steps_complete( $step_slug ) { 3717 global $bp;3721 $bp = buddypress(); 3718 3722 3719 3723 /* If this is the first group creation step, return true */ … … 3740 3744 } 3741 3745 function bp_get_new_group_id() { 3742 global $bp;3746 $bp = buddypress(); 3743 3747 3744 3748 if ( isset( $bp->groups->new_group_id ) ) … … 3754 3758 } 3755 3759 function bp_get_new_group_name() { 3756 global $bp;3760 $bp = buddypress(); 3757 3761 3758 3762 if ( isset( $bp->groups->current_group->name ) ) … … 3768 3772 } 3769 3773 function bp_get_new_group_description() { 3770 global $bp;3774 $bp = buddypress(); 3771 3775 3772 3776 if ( isset( $bp->groups->current_group->description ) ) … … 3782 3786 } 3783 3787 function bp_get_new_group_enable_forum() { 3784 global $bp; 3788 $bp = buddypress(); 3789 3785 3790 return (int) apply_filters( 'bp_get_new_group_enable_forum', $bp->groups->current_group->enable_forum ); 3786 3791 } … … 3790 3795 } 3791 3796 function bp_get_new_group_status() { 3792 global $bp; 3797 $bp = buddypress(); 3798 3793 3799 return apply_filters( 'bp_get_new_group_status', $bp->groups->current_group->status ); 3794 3800 } … … 3798 3804 } 3799 3805 function bp_get_new_group_avatar( $args = '' ) { 3800 global $bp;3806 $bp = buddypress(); 3801 3807 3802 3808 $defaults = array( … … 3820 3826 } 3821 3827 function bp_get_group_creation_previous_link() { 3822 global $bp;3828 $bp = buddypress(); 3823 3829 3824 3830 foreach ( (array) $bp->groups->group_creation_steps as $slug => $name ) { … … 3849 3855 */ 3850 3856 function bp_get_groups_current_create_step() { 3851 global $bp;3857 $bp = buddypress(); 3852 3858 3853 3859 if ( !empty( $bp->groups->current_create_step ) ) { … … 3861 3867 3862 3868 function bp_is_last_group_creation_step() { 3863 global $bp;3869 $bp = buddypress(); 3864 3870 3865 3871 $keys = array_keys( $bp->groups->group_creation_steps ); … … 3873 3879 3874 3880 function bp_is_first_group_creation_step() { 3875 global $bp;3881 $bp = buddypress(); 3876 3882 3877 3883 $keys = array_keys( $bp->groups->group_creation_steps ); … … 3888 3894 } 3889 3895 function bp_get_new_group_invite_friend_list( $args = '' ) { 3890 global $bp;3896 $bp = buddypress(); 3891 3897 3892 3898 if ( !bp_is_active( 'friends' ) ) … … 3945 3951 */ 3946 3952 function bp_groups_header_tabs() { 3947 global $bp;?>3953 $bp = buddypress(); ?> 3948 3954 3949 3955 <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_displayed_user_domain() . bp_get_groups_slug() . '/my-groups/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li> … … 4095 4101 } 4096 4102 function bp_get_group_avatar_delete_link() { 4097 global $bp;4103 $bp = buddypress(); 4098 4104 4099 4105 return apply_filters( 'bp_get_group_avatar_delete_link', wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/group-avatar/delete', 'bp_group_avatar_delete' ) );
Note: See TracChangeset
for help on using the changeset viewer.