Changeset 8150 for trunk/bp-groups/bp-groups-template.php
- Timestamp:
- 03/24/2014 07:11:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r8142 r8150 3074 3074 */ 3075 3075 function bp_group_has_membership_requests( $args = '' ) { 3076 global $requests_template , $groups_template;3076 global $requests_template; 3077 3077 3078 3078 $defaults = array( 3079 'group_id' => $groups_template->group->id,3079 'group_id' => bp_get_current_group_id(), 3080 3080 'per_page' => 10, 3081 3081 'page' => 1, … … 3111 3111 } 3112 3112 function bp_get_group_request_reject_link() { 3113 global $requests_template , $groups_template;3114 3115 return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . 'admin/membership-requests/reject/' . $requests_template->request->id, 'groups_reject_membership_request' ) );3113 global $requests_template; 3114 3115 return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/reject/' . $requests_template->request->membership_id, 'groups_reject_membership_request' ) ); 3116 3116 } 3117 3117 … … 3120 3120 } 3121 3121 function bp_get_group_request_accept_link() { 3122 global $requests_template , $groups_template;3123 3124 return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( $groups_template->group ) . 'admin/membership-requests/accept/' . $requests_template->request->id, 'groups_accept_membership_request' ) );3122 global $requests_template; 3123 3124 return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/accept/' . $requests_template->request->membership_id, 'groups_accept_membership_request' ) ); 3125 3125 } 3126 3126 … … 3145 3145 echo apply_filters( 'bp_group_request_comment', strip_tags( stripslashes( $requests_template->request->comments ) ) ); 3146 3146 } 3147 3148 /** 3149 * Output pagination links for group membership requests. 3150 * 3151 * @since BuddyPress (2.0.0) 3152 */ 3153 function bp_group_requests_pagination_links() { 3154 echo bp_get_group_requests_pagination_links(); 3155 } 3156 /** 3157 * Get pagination links for group membership requests. 3158 * 3159 * @since BuddyPress (2.0.0) 3160 * 3161 * @return string 3162 */ 3163 function bp_get_group_requests_pagination_links() { 3164 global $requests_template; 3165 return apply_filters( 'bp_get_group_requests_pagination_links', $requests_template->pag_links ); 3166 } 3167 3168 /** 3169 * Output pagination count text for group membership requests. 3170 * 3171 * @since BuddyPress (2.0.0) 3172 */ 3173 function bp_group_requests_pagination_count() { 3174 echo bp_get_group_requests_pagination_count(); 3175 } 3176 /** 3177 * Get pagination count text for group membership requests. 3178 * 3179 * @since BuddyPress (2.0.0) 3180 * 3181 * @return string 3182 */ 3183 function bp_get_group_requests_pagination_count() { 3184 global $requests_template; 3185 3186 $start_num = intval( ( $requests_template->pag_page - 1 ) * $requests_template->pag_num ) + 1; 3187 $from_num = bp_core_number_format( $start_num ); 3188 $to_num = bp_core_number_format( ( $start_num + ( $requests_template->pag_num - 1 ) > $requests_template->total_request_count ) ? $requests_template->total_request_count : $start_num + ( $requests_template->pag_num - 1 ) ); 3189 $total = bp_core_number_format( $requests_template->total_request_count ); 3190 3191 return apply_filters( 'bp_get_group_requests_pagination_count', sprintf( _n( 'Viewing requests %1$s to %2$s (of %3$s request)', 'Viewing request %1$s to %2$s (of %3$s requests)', $total, 'buddypress' ), $from_num, $to_num, $total ), $from_num, $to_num, $total ); 3192 } 3147 3193 3148 3194 /************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.