當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Groups_Group::delete方法代碼示例

本文整理匯總了PHP中BP_Groups_Group::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Groups_Group::delete方法的具體用法?PHP BP_Groups_Group::delete怎麽用?PHP BP_Groups_Group::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_Groups_Group的用法示例。


在下文中一共展示了BP_Groups_Group::delete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: bp_group_management_delete_group

function bp_group_management_delete_group($group_id)
{
    global $bp;
    $group = new BP_Groups_Group($group_id);
    if (!$group->delete()) {
        return false;
    }
    /* Delete all group activity from activity streams */
    if (function_exists('bp_activity_delete_by_item_id')) {
        bp_activity_delete_by_item_id(array('item_id' => $group_id, 'component' => $bp->groups->id));
    }
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->slug);
    do_action('groups_delete_group', $group_id);
    return true;
}
開發者ID:adisonc,項目名稱:MaineLearning,代碼行數:18,代碼來源:bp-group-management-aux.php

示例2: test_delete_clear_cache

 /**
  * @group delete
  * @group cache
  */
 public function test_delete_clear_cache()
 {
     $g = $this->factory->group->create();
     // Prime cache
     groups_get_group(array('group_id' => $g));
     $this->assertNotEmpty(wp_cache_get($g, 'bp_groups'));
     $group = new BP_Groups_Group($g);
     $group->delete();
     $this->assertFalse(wp_cache_get($g, 'bp_groups'));
 }
開發者ID:swissspidy,項目名稱:BuddyPress,代碼行數:14,代碼來源:class-bp-groups-group.php

示例3: groups_delete_group

/**
 * Delete a group and all of its associated meta
 *
 * @global object $bp BuddyPress global settings
 * @param int $group_id
 * @since 1.0
 */
function groups_delete_group($group_id)
{
    global $bp;
    // Check the user is the group admin.
    if (!$bp->is_item_admin) {
        return false;
    }
    // Get the group object
    $group = new BP_Groups_Group($group_id);
    if (!$group->delete()) {
        return false;
    }
    do_action('groups_before_delete_group', $group_id);
    // Delete all group activity from activity streams
    if (bp_is_active('activity')) {
        bp_activity_delete_by_item_id(array('item_id' => $group_id, 'component' => $bp->groups->id));
    }
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->id);
    // Remove forum if component is active and current group has one
    if (bp_is_active('forums') && ($forum_id = groups_get_groupmeta($group_id, 'forum_id'))) {
        do_action('bbpress_init');
        bb_delete_forum($forum_id);
    }
    do_action('groups_delete_group', $group_id);
    return true;
}
開發者ID:nxtclass,項目名稱:NXTClass-Plugin,代碼行數:36,代碼來源:bp-groups-functions.php

示例4: groups_delete_group

function groups_delete_group($group_id)
{
    global $bp;
    /* Check the nonce first. */
    if (!check_admin_referer('groups_delete_group')) {
        return false;
    }
    // Check the user is the group admin.
    if (!$bp->is_item_admin) {
        return false;
    }
    // Get the group object
    $group = new BP_Groups_Group($group_id);
    if (!$group->delete()) {
        return false;
    }
    // Remove the activity stream item
    groups_delete_activity(array('item_id' => $group_id, 'component_name' => $bp->groups->slug, 'component_action' => 'created_group', 'user_id' => $bp->loggedin_user->id));
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->slug);
    do_action('groups_delete_group', $group_id);
    return true;
}
開發者ID:alvaropereyra,項目名稱:shrekcms,代碼行數:25,代碼來源:bp-groups.php

示例5: groups_admin_settings

function groups_admin_settings()
{
    if (isset($_POST['groups_admin_delete']) && isset($_POST['allgroups'])) {
        if (!check_admin_referer('bp-groups-admin')) {
            return false;
        }
        $errors = false;
        foreach ($_POST['allgroups'] as $group_id) {
            $group = new BP_Groups_Group($group_id);
            if (!$group->delete()) {
                $errors = true;
            }
        }
        if ($errors) {
            $message = __('There were errors when deleting groups, please try again', 'buddypress');
            $type = 'error';
        } else {
            $message = __('Groups deleted successfully', 'buddypress');
            $type = 'updated';
        }
    }
    ?>
	<?php 
    if (isset($message)) {
        ?>
		<div id="message" class="<?php 
        echo $type;
        ?>
 fade">
			<p><?php 
        echo $message;
        ?>
</p>
		</div>
	<?php 
    }
    ?>

	<div class="wrap" style="position: relative">
		<h2><?php 
    _e('Groups', 'buddypress');
    ?>
</h2>
	
		<form id="wpmu-search" method="post" action="">
			<input type="text" size="17" value="<?php 
    echo attribute_escape(stripslashes($_REQUEST['s']));
    ?>
" name="s" />
			<input id="post-query-submit" class="button" type="submit" value="<?php 
    _e('Search Groups', 'buddypress');
    ?>
" />
		</form>
		
		<?php 
    if (bp_has_site_groups('type=active&per_page=10')) {
        ?>
			<form id="bp-group-admin-list" method="post" action="">
				<div class="tablenav">
					<div class="tablenav-pages">
						<?php 
        bp_site_groups_pagination_count();
        ?>
 <?php 
        bp_site_groups_pagination_links();
        ?>
					</div>
					<div class="alignleft">
						<input class="button-secondary delete" type="submit" name="groups_admin_delete" value="<?php 
        _e('Delete', 'buddypress');
        ?>
" onclick="if ( !confirm('<?php 
        _e('Are you sure?', 'buddypress');
        ?>
') ) return false"/>
						<?php 
        wp_nonce_field('bp-groups-admin');
        ?>
						<br class="clear"/>
					</div>
				</div>
				
				<br class="clear"/>
				
				<?php 
        if (isset($_REQUEST['s']) && $_REQUEST['s'] != '') {
            ?>
					<p><?php 
            echo sprintf(__('Groups matching: "%s"', 'buddypress'), $_REQUEST['s']);
            ?>
</p>
				<?php 
        }
        ?>


				<table class="widefat" cellspacing="3" cellpadding="3">
					<thead>
						<tr>
//.........這裏部分代碼省略.........
開發者ID:alvaropereyra,項目名稱:shrekcms,代碼行數:101,代碼來源:bp-groups-admin.php


注:本文中的BP_Groups_Group::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。