groups_screen_group_admin_delete_group ()

处理“删除组”页面的显示。

描述

文件:/单/ admin / delete-group.php bp-groups /屏幕

函数group_screen_group_admin_delete_group () {if ('delete-group' != bp_get_group_current_admin_tab())返回false;如果(!Bp_is_item_admin () && !bp_current_user_can('bp_moderate'))返回false;英国石油美元= buddypress ();if (isset($_REQUEST['delete-group-button']) && isset($_REQUEST['delete-group-understand'])){//先检查nonce。If (!check_admin_referer('groups_delete_group')){返回false;} /** *从删除组页面删除组之前触发。* * @since BuddyPress 1.5.0 * * @param int $id被删除组的id。*/ do_action(' group_before_group_delete ', $bp->groups->current_group->id);//删除论坛if (isset($_REQUEST[' Delete -group-forum-understand'])) {$forum_ids = bbp_get_group_forum_ids($bp->groups->current_group->id); foreach ( $forum_ids as $forum_id ) { wp_delete_post( $forum_id, true ); } } // Group admin has deleted the group, now do it. if ( !groups_delete_group( $bp->groups->current_group->id ) ) { bp_core_add_message( __( 'There was an error deleting the group. Please try again.', 'buddyboss' ), 'error' ); } else { bp_core_add_message( __( 'The group was deleted successfully.', 'buddyboss' ) ); /** * Fires after the deletion of a group from the Delete Group page. * * @since BuddyPress 1.0.0 * * @param int $id ID of the group being deleted. */ do_action( 'groups_group_deleted', $bp->groups->current_group->id ); bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) ); } bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) ); } /** * Fires before the loading of the Delete Group page template. * * @since BuddyPress 1.0.0 * * @param int $id ID of the group that is being displayed. */ do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id ); /** * Filters the template to load for the Delete Group page. * * @since BuddyPress 1.0.0 * * @param string $value Path to the Delete Group template. */ bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) ); }

更新日志

更新日志
版本 描述
BuddyPress 1.0.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队