Changeset 13762
- Timestamp:
- 03/09/2024 10:55:43 AM (15 months ago)
- Location:
- trunk/src/bp-groups
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/actions/create.php
r13449 r13762 13 13 * @since 1.2.0 14 14 * 15 * @return bool15 * @return void 16 16 */ 17 17 function groups_action_create_group() { … … 19 19 // If we're not at domain.org/groups/create/ then return false. 20 20 if ( ! bp_is_groups_component() || ! bp_is_current_action( 'create' ) ) { 21 return false;21 return; 22 22 } 23 23 24 24 if ( ! is_user_logged_in() ) { 25 return false;25 return; 26 26 } 27 27 -
trunk/src/bp-groups/actions/join.php
r13437 r13762 13 13 * @since 1.0.0 14 14 * 15 * @return bool15 * @return void 16 16 */ 17 17 function groups_action_join_group() { 18 18 19 if ( !bp_is_single_item() || !bp_is_groups_component() || !bp_is_current_action( 'join' ) ) 20 return false; 19 if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'join' ) ) { 20 return; 21 } 21 22 22 23 // Nonce check. 23 if ( !check_admin_referer( 'groups_join_group' ) ) 24 return false; 24 if ( ! check_admin_referer( 'groups_join_group' ) ) { 25 return; 26 } 25 27 26 28 $bp = buddypress(); 27 29 28 30 // Skip if banned or already a member. 29 if ( ! groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && !groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {31 if ( ! groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) && ! groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { 30 32 31 33 // User wants to join a group that requires an invitation to join. 32 34 if ( ! bp_current_user_can( 'groups_join_group', array( 'group_id' => $bp->groups->current_group->id ) ) ) { 33 if ( ! groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) {35 if ( ! groups_check_user_has_invite( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { 34 36 bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' ); 35 37 bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) ); … … 38 40 39 41 // User wants to join any group. 40 if ( ! groups_join_group( $bp->groups->current_group->id ) )42 if ( ! groups_join_group( $bp->groups->current_group->id ) ) { 41 43 bp_core_add_message( __( 'There was an error joining the group.', 'buddypress' ), 'error' ); 42 else44 } else { 43 45 bp_core_add_message( __( 'You joined the group!', 'buddypress' ) ); 46 } 44 47 45 48 bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) ); 46 49 } 47 50 48 /** 49 * Filters the template to load for the single group screen. 50 * 51 * @since 1.0.0 52 * 53 * @param string $value Path to the single group template to load. 54 */ 55 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 51 $templates = array( 52 /** 53 * Filters the template to load for the single group screen. 54 * 55 * @since 1.0.0 56 * 57 * @param string $value Path to the single group template to load. 58 */ 59 apply_filters( 'groups_template_group_home', 'groups/single/home' ), 60 'groups/single/index', 61 ); 62 63 bp_core_load_template( $templates ); 56 64 } 57 65 add_action( 'bp_actions', 'groups_action_join_group' ); -
trunk/src/bp-groups/actions/leave-group.php
r13503 r13762 19 19 * @since 1.2.4 20 20 * 21 * @return bool21 * @return void 22 22 */ 23 23 function groups_action_leave_group() { 24 24 if ( ! bp_is_single_item() || ! bp_is_groups_component() || ! bp_is_current_action( 'leave-group' ) ) { 25 return false;25 return; 26 26 } 27 27 28 28 // Nonce check. 29 29 if ( ! check_admin_referer( 'groups_leave_group' ) ) { 30 return false;30 return; 31 31 } 32 32 … … 56 56 } 57 57 58 /** This filter is documented in bp-groups/bp-groups-actions.php */ 59 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 58 $templates = array( 59 /** This filter is documented in bp-groups/actions/join.php */ 60 apply_filters( 'groups_template_group_home', 'groups/single/home' ), 61 'groups/single/index', 62 ); 63 64 bp_core_load_template( $templates ); 60 65 } 61 66 add_action( 'bp_actions', 'groups_action_leave_group' ); -
trunk/src/bp-groups/screens/single/activity-permalink.php
r11923 r13762 15 15 * 16 16 * @since 1.2.0 17 * 18 * @return void 17 19 */ 18 20 function groups_screen_group_activity_permalink() { 19 if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) ) 20 return false; 21 if ( ! bp_is_groups_component() || ! bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && ! bp_is_current_action( bp_get_activity_slug() ) ) || ! bp_action_variable( 0 ) ) { 22 return; 23 } 21 24 22 25 buddypress()->is_single_item = true; 23 26 24 /** This filter is documented in bp-groups/bp-groups-screens.php */ 25 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 27 $templates = array( 28 /** This filter is documented in bp-groups/screens/home.php */ 29 apply_filters( 'groups_template_group_home', 'groups/single/home' ), 30 'groups/single/index', 31 ); 32 33 bp_core_load_template( $templates ); 26 34 } 27 35 add_action( 'bp_screens', 'groups_screen_group_activity_permalink' ); -
trunk/src/bp-groups/screens/single/activity.php
r11923 r13762 12 12 * 13 13 * @since 2.4.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_activity() { 16 18 17 19 if ( ! bp_is_single_item() ) { 18 return false;20 return; 19 21 } 20 22 … … 26 28 do_action( 'groups_screen_group_activity' ); 27 29 28 /** 29 * Filters the template to load for a single group's activity page. 30 * 31 * @since 2.4.0 32 * 33 * @param string $value Path to a single group's template to load. 34 */ 35 bp_core_load_template( apply_filters( 'groups_screen_group_activity', 'groups/single/activity' ) ); 30 $templates = array( 31 /** 32 * Filters the template to load for a single group's activity page. 33 * 34 * @since 2.4.0 35 * 36 * @param string $value Path to a single group's template to load. 37 */ 38 apply_filters( 'groups_screen_group_activity', 'groups/single/activity' ), 39 'groups/single/index', 40 ); 41 42 bp_core_load_template( $templates ); 36 43 } -
trunk/src/bp-groups/screens/single/admin/delete-group.php
r13503 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_delete_group() { 16 18 17 19 if ( 'delete-group' != bp_get_group_current_admin_tab() ) { 18 return false;20 return; 19 21 } 20 22 21 23 if ( ! bp_is_item_admin() && ! bp_current_user_can( 'bp_moderate' ) ) { 22 return false;24 return; 23 25 } 24 26 … … 31 33 // Check the nonce first. 32 34 if ( ! check_admin_referer( 'groups_delete_group' ) ) { 33 return false;35 return; 34 36 } 35 37 … … 71 73 do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id ); 72 74 73 /** 74 * Filters the template to load for the Delete Group page. 75 * 76 * @since 1.0.0 77 * 78 * @param string $value Path to the Delete Group template. 79 */ 80 bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) ); 75 $templates = array( 76 /** 77 * Filters the template to load for the Delete Group page. 78 * 79 * @since 1.0.0 80 * 81 * @param string $value Path to the Delete Group template. 82 */ 83 apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ), 84 'groups/single/index', 85 ); 86 87 bp_core_load_template( $templates ); 81 88 } 82 89 add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' ); -
trunk/src/bp-groups/screens/single/admin/edit-details.php
r13446 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_edit_details() { 16 18 17 if ( 'edit-details' != bp_get_group_current_admin_tab() ) 18 return false; 19 if ( 'edit-details' !== bp_get_group_current_admin_tab() ) { 20 return; 21 } 19 22 20 23 if ( bp_is_item_admin() ) { … … 25 28 if ( isset( $_POST['save'] ) ) { 26 29 // Check the nonce. 27 if ( !check_admin_referer( 'groups_edit_group_details' ) ) 28 return false; 30 if ( ! check_admin_referer( 'groups_edit_group_details' ) ) { 31 return; 32 } 29 33 30 34 $group_notify_members = isset( $_POST['group-notify-members'] ) ? (int) $_POST['group-notify-members'] : 0; … … 71 75 do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id ); 72 76 73 /** 74 * Filters the template to load for a group's admin/edit-details page. 75 * 76 * @since 1.0.0 77 * 78 * @param string $value Path to a group's admin/edit-details template. 79 */ 80 bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) ); 77 $templates = array( 78 /** 79 * Filters the template to load for a group's admin/edit-details page. 80 * 81 * @since 1.0.0 82 * 83 * @param string $value Path to a group's admin/edit-details template. 84 */ 85 apply_filters( 'groups_template_group_admin', 'groups/single/home' ), 86 'groups/single/index', 87 ); 88 89 bp_core_load_template( $templates ); 81 90 } 82 91 } -
trunk/src/bp-groups/screens/single/admin/group-avatar.php
r13177 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_avatar() { 16 18 17 if ( 'group-avatar' != bp_get_group_current_admin_tab() ) 18 return false; 19 if ( 'group-avatar' !== bp_get_group_current_admin_tab() ) { 20 return; 21 } 19 22 20 23 // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here. 21 if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) 22 return false; 24 if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) { 25 return; 26 } 23 27 24 28 $bp = buddypress(); … … 43 47 $bp->avatar_admin->step = 'upload-image'; 44 48 45 if ( ! empty( $_FILES ) ) {49 if ( ! empty( $_FILES ) ) { 46 50 47 51 // Check the nonce. … … 105 109 do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id ); 106 110 107 /** 108 * Filters the template to load for a group's Change Avatar page. 109 * 110 * @since 1.0.0 111 * 112 * @param string $value Path to a group's Change Avatar template. 113 */ 114 bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) ); 111 $templates = array( 112 /** 113 * Filters the template to load for a group's Change Avatar page. 114 * 115 * @since 1.0.0 116 * 117 * @param string $value Path to a group's Change Avatar template. 118 */ 119 apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ), 120 'groups/single/index', 121 ); 122 123 bp_core_load_template( $templates ); 115 124 } 116 125 add_action( 'bp_screens', 'groups_screen_group_admin_avatar' ); -
trunk/src/bp-groups/screens/single/admin/group-cover-image.php
r11923 r13762 12 12 * 13 13 * @since 2.4.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_cover_image() { 16 18 if ( 'group-cover-image' != bp_get_group_current_admin_tab() ) { 17 return false;19 return; 18 20 } 19 21 20 22 // If the logged-in user doesn't have permission or if cover image uploads are disabled, then stop here. 21 23 if ( ! bp_is_item_admin() || ! bp_group_use_cover_image_header() ) { 22 return false;24 return; 23 25 } 24 26 … … 32 34 do_action( 'groups_screen_group_admin_cover_image', bp_get_current_group_id() ); 33 35 34 /** 35 * Filters the template to load for a group's Change cover image page. 36 * 37 * @since 2.4.0 38 * 39 * @param string $value Path to a group's Change cover image template. 40 */ 41 bp_core_load_template( apply_filters( 'groups_template_group_admin_cover_image', 'groups/single/home' ) ); 36 $templates = array( 37 /** 38 * Filters the template to load for a group's Change cover image page. 39 * 40 * @since 2.4.0 41 * 42 * @param string $value Path to a group's Change cover image template. 43 */ 44 apply_filters( 'groups_template_group_admin_cover_image', 'groups/single/home' ), 45 'groups/single/index', 46 ); 47 48 bp_core_load_template( $templates ); 42 49 } 43 50 add_action( 'bp_screens', 'groups_screen_group_admin_cover_image' ); -
trunk/src/bp-groups/screens/single/admin/group-settings.php
r13446 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_settings() { 16 18 17 if ( 'group-settings' != bp_get_group_current_admin_tab() ) 18 return false; 19 if ( 'group-settings' !== bp_get_group_current_admin_tab() ) { 20 return; 21 } 19 22 20 if ( ! bp_is_item_admin() ) 21 return false; 23 if ( ! bp_is_item_admin() ) { 24 return; 25 } 22 26 23 27 $bp = buddypress(); … … 38 42 39 43 // Check the nonce. 40 if ( !check_admin_referer( 'groups_edit_group_settings' ) ) 41 return false; 44 if ( ! check_admin_referer( 'groups_edit_group_settings' ) ) { 45 return; 46 } 42 47 43 48 $group_id = bp_get_current_group_id(); … … 101 106 do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id ); 102 107 103 /** 104 * Filters the template to load for a group's admin/group-settings page. 105 * 106 * @since 1.0.0 107 * 108 * @param string $value Path to a group's admin/group-settings template. 109 */ 110 bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) ); 108 $templates = array( 109 /** 110 * Filters the template to load for a group's admin/group-settings page. 111 * 112 * @since 1.0.0 113 * 114 * @param string $value Path to a group's admin/group-settings template. 115 */ 116 apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ), 117 'groups/single/index', 118 ); 119 120 bp_core_load_template( $templates ); 111 121 } 112 122 add_action( 'bp_screens', 'groups_screen_group_admin_settings' ); -
trunk/src/bp-groups/screens/single/admin/manage-members.php
r13446 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_manage_members() { 16 18 17 19 if ( 'manage-members' != bp_get_group_current_admin_tab() ) { 18 return false;20 return; 19 21 } 20 22 21 23 if ( ! bp_is_item_admin() ) { 22 return false;24 return; 23 25 } 24 26 … … 36 38 // Check the nonce first. 37 39 if ( ! check_admin_referer( 'groups_promote_member' ) ) { 38 return false;40 return; 39 41 } 40 42 … … 66 68 // Check the nonce first. 67 69 if ( ! check_admin_referer( 'groups_demote_member' ) ) { 68 return false;70 return; 69 71 } 70 72 … … 99 101 // Check the nonce first. 100 102 if ( ! check_admin_referer( 'groups_ban_member' ) ) { 101 return false;103 return; 102 104 } 103 105 … … 127 129 // Check the nonce first. 128 130 if ( ! check_admin_referer( 'groups_unban_member' ) ) { 129 return false;131 return; 130 132 } 131 133 … … 155 157 // Check the nonce first. 156 158 if ( ! check_admin_referer( 'groups_remove_member' ) ) { 157 return false;159 return; 158 160 } 159 161 … … 188 190 do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id ); 189 191 190 /** 191 * Filters the template to load for a group's manage members page. 192 * 193 * @since 1.0.0 194 * 195 * @param string $value Path to a group's manage members template. 196 */ 197 bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) ); 192 $templates = array( 193 /** 194 * Filters the template to load for a group's manage members page. 195 * 196 * @since 1.0.0 197 * 198 * @param string $value Path to a group's manage members template. 199 */ 200 apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ), 201 'groups/single/index', 202 ); 203 204 bp_core_load_template( $templates ); 198 205 } 199 206 add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' ); -
trunk/src/bp-groups/screens/single/admin/membership-requests.php
r13446 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_admin_requests() { … … 17 19 18 20 if ( 'membership-requests' != bp_get_group_current_admin_tab() ) { 19 return false;21 return; 20 22 } 21 23 22 if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) ) {23 return false;24 if ( ! bp_is_item_admin() || ( 'public' === $bp->groups->current_group->status ) ) { 25 return; 24 26 } 25 27 … … 33 35 // Check the nonce first. 34 36 if ( ! check_admin_referer( 'groups_accept_membership_request' ) ) { 35 return false;37 return; 36 38 } 37 39 … … 46 48 /* Check the nonce first. */ 47 49 if ( ! check_admin_referer( 'groups_reject_membership_request' ) ) { 48 return false;50 return; 49 51 } 50 52 … … 90 92 do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id ); 91 93 92 /** 93 * Filters the template to load for a group's membership request page. 94 * 95 * @since 1.0.0 96 * 97 * @param string $value Path to a group's membership request template. 98 */ 99 bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) ); 94 $templates = array( 95 /** 96 * Filters the template to load for a group's membership request page. 97 * 98 * @since 1.0.0 99 * 100 * @param string $value Path to a group's membership request template. 101 */ 102 apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ), 103 'groups/single/index', 104 ); 105 106 bp_core_load_template( $templates ); 100 107 } 101 108 add_action( 'bp_screens', 'groups_screen_group_admin_requests' ); -
trunk/src/bp-groups/screens/single/home.php
r11923 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_home() { 16 18 17 19 if ( ! bp_is_single_item() ) { 18 return false;20 return; 19 21 } 20 22 … … 26 28 do_action( 'groups_screen_group_home' ); 27 29 28 /** 29 * Filters the template to load for a single group's page. 30 * 31 * @since 1.0.0 32 * 33 * @param string $value Path to a single group's template to load. 34 */ 35 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 30 $templates = array( 31 /** 32 * Filters the template to load for a single group's page. 33 * 34 * @since 1.0.0 35 * 36 * @param string $value Path to a single group's template to load. 37 */ 38 apply_filters( 'groups_template_group_home', 'groups/single/home' ), 39 'groups/single/index', 40 ); 41 42 bp_core_load_template( $templates ); 36 43 } -
trunk/src/bp-groups/screens/single/members.php
r13103 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_members() { 16 18 17 19 if ( ! bp_is_single_item() ) { 18 return false;20 return; 19 21 } 20 22 … … 30 32 do_action( 'groups_screen_group_members', $bp->groups->current_group->id ); 31 33 32 /** 33 * Filters the template to load for a group's Members page. 34 * 35 * @since 1.0.0 36 * 37 * @param string $value Path to a group's Members template. 38 */ 39 bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) ); 34 $templates = array( 35 /** 36 * Filters the template to load for a group's Members page. 37 * 38 * @since 1.0.0 39 * 40 * @param string $value Path to a group's Members template. 41 */ 42 apply_filters( 'groups_template_group_members', 'groups/single/home' ), 43 'groups/single/index', 44 ); 45 46 bp_core_load_template( $templates ); 40 47 } -
trunk/src/bp-groups/screens/single/request-membership.php
r13437 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_request_membership() { 16 18 17 19 if ( ! is_user_logged_in() ) { 18 return false;20 return; 19 21 } 20 22 … … 22 24 23 25 if ( 'private' != $bp->groups->current_group->status ) { 24 return false;26 return; 25 27 } 26 28 … … 41 43 // Check the nonce. 42 44 if ( ! check_admin_referer( 'groups_request_membership' ) ) { 43 return false;45 return; 44 46 } 45 47 … … 60 62 bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) ); 61 63 } 64 62 65 bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) ); 63 66 } … … 72 75 do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id ); 73 76 74 /** 75 * Filters the template to load for a group's Request Membership page. 76 * 77 * @since 1.0.0 78 * 79 * @param string $value Path to a group's Request Membership template. 80 */ 81 bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) ); 77 $templates = array( 78 /** 79 * Filters the template to load for a group's Request Membership page. 80 * 81 * @since 1.0.0 82 * 83 * @param string $value Path to a group's Request Membership template. 84 */ 85 apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ), 86 'groups/single/index', 87 ); 88 89 bp_core_load_template( $templates ); 82 90 } -
trunk/src/bp-groups/screens/single/send-invites.php
r13437 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_invite() { 16 18 17 if ( !bp_is_single_item() ) 18 return false; 19 if ( ! bp_is_single_item() ) { 20 return; 21 } 19 22 20 23 $bp = buddypress(); … … 22 25 if ( bp_is_action_variable( 'send', 0 ) ) { 23 26 24 if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) 25 return false; 27 if ( ! check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) { 28 return; 29 } 26 30 27 if ( ! empty( $_POST['friends'] ) ) {31 if ( ! empty( $_POST['friends'] ) ) { 28 32 foreach( (array) $_POST['friends'] as $friend ) { 29 33 groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) ); … … 45 49 bp_core_redirect( bp_get_group_url( $bp->groups->current_group ) ); 46 50 47 } elseif ( ! bp_action_variable( 0 ) ) {51 } elseif ( ! bp_action_variable( 0 ) ) { 48 52 49 /** 50 * Filters the template to load for a group's Send Invites page. 51 * 52 * @since 1.0.0 53 * 54 * @param string $value Path to a group's Send Invites template. 55 */ 56 bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) ); 53 $templates = array( 54 /** 55 * Filters the template to load for a group's Send Invites page. 56 * 57 * @since 1.0.0 58 * 59 * @param string $value Path to a group's Send Invites template. 60 */ 61 apply_filters( 'groups_template_group_invite', 'groups/single/home' ), 62 'groups/single/index', 63 ); 64 65 bp_core_load_template( $templates ); 57 66 58 67 } else { … … 68 77 * 69 78 * @since 2.0.0 79 * 80 * @return void 70 81 */ 71 82 function groups_remove_group_invite() { … … 79 90 80 91 if ( ! check_admin_referer( 'groups_invite_uninvite_user' ) ) { 81 return false;92 return; 82 93 } 83 94 -
trunk/src/bp-groups/screens/user/invites.php
r13482 r13762 12 12 * 13 13 * @since 1.0.0 14 * 15 * @return void 14 16 */ 15 17 function groups_screen_group_invites() { … … 19 21 // Check the nonce. 20 22 if ( ! check_admin_referer( 'groups_accept_invite' ) ) { 21 return false;23 return; 22 24 } 23 25 … … 50 52 } elseif ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) { 51 53 // Check the nonce. 52 if ( ! check_admin_referer( 'groups_reject_invite' ) )53 return false;54 if ( ! check_admin_referer( 'groups_reject_invite' ) ) 55 return; 54 56 55 57 if ( ! groups_reject_invite( bp_displayed_user_id(), $group_id ) ) { … … 78 80 do_action( 'groups_screen_group_invites', $group_id ); 79 81 80 /** 81 * Filters the template to load for a users Groups > Invites page. 82 * 83 * @since 1.0.0 84 * 85 * @param string $value Path to a users Groups > Invites page template. 86 */ 87 bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) ); 82 $templates = array( 83 /** 84 * Filters the template to load for a users Groups > Invites page. 85 * 86 * @since 1.0.0 87 * 88 * @param string $value Path to a users Groups > Invites page template. 89 */ 90 apply_filters( 'groups_template_group_invites', 'members/single/home' ), 91 'members/single/index', 92 ); 93 94 bp_core_load_template( $templates ); 88 95 } -
trunk/src/bp-groups/screens/user/my-groups.php
r11923 r13762 22 22 do_action( 'groups_screen_my_groups' ); 23 23 24 /** 25 * Filters the template to load for the My Groups page. 26 * 27 * @since 1.0.0 28 * 29 * @param string $value Path to the My Groups page template to load. 30 */ 31 bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) ); 24 $templates = array( 25 /** 26 * Filters the template to load for the My Groups page. 27 * 28 * @since 1.0.0 29 * 30 * @param string $value Path to the My Groups page template to load. 31 */ 32 apply_filters( 'groups_template_my_groups', 'members/single/home' ), 33 'members/single/index', 34 ); 35 36 bp_core_load_template( $templates ); 32 37 }
Note: See TracChangeset
for help on using the changeset viewer.