groups_screen_group_request_membership ()
处理组的“请求成员资格”页面的显示。
描述
源
文件:bp-groups /屏幕/单/ request-membership.php
Function group_screen_group_request_membership () {if (!is_user_logged_in())返回false;英国石油美元= buddypress ();If ('private' != $bp->groups->current_group->status)返回false;//如果用户已经被邀请,接受邀请。if (group_check_user_has_invite (bp_loggedin_user_id(), $bp->groups->current_group->id)) {if (group_accept_invite (bp_loggedin_user_id(), $bp->groups->current_group->id)) bp_core_add_message(__('Group invite accepted', 'buddyboss'));else bp_core_add_message(__('有一个错误接受组邀请。请再试一次。', 'buddyboss'), 'error');Bp_core_redirect (bp_get_group_permalink($bp->groups->current_group));} //如果用户提交了请求,则发送它。 if ( isset( $_POST['group-request-send']) ) { // Check the nonce. if ( !check_admin_referer( 'groups_request_membership' ) ) return false; if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { bp_core_add_message( __( 'There was an error sending your group membership request. Please try again.', 'buddyboss' ), 'error' ); } else { bp_core_add_message( __( 'Your membership request was sent to the group organizer successfully. You will be notified when the group organizer responds to your request.', 'buddyboss' ) ); } bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); } /** * Fires before the loading of a group's Request Memebership page. * * @since BuddyPress 1.0.0 * * @param int $id ID of the group currently being displayed. */ do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id ); /** * Filters the template to load for a group's Request Membership page. * * @since BuddyPress 1.0.0 * * @param string $value Path to a group's Request Membership template. */ bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 1.0.0 | 介绍了。 |