本文整理匯總了PHP中Groups::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Groups::delete方法的具體用法?PHP Groups::delete怎麽用?PHP Groups::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Groups
的用法示例。
在下文中一共展示了Groups::delete方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: AdminPage
<?php
require_once './config.php';
// Login check.
$admin = new AdminPage();
$group = new Groups(['Settings' => $admin->settings]);
// session_write_close(); allows the admin to use the site while the ajax request is being processed.
if (isset($_GET['action']) && $_GET['action'] == "2") {
$id = (int) $_GET['group_id'];
session_write_close();
$group->delete($id);
print "Group {$id} deleted.";
} else {
if (isset($_GET['action']) && $_GET['action'] == "3") {
$id = (int) $_GET['group_id'];
session_write_close();
$group->reset($id);
print "Group {$id} reset.";
} else {
if (isset($_GET['action']) && $_GET['action'] == "4") {
$id = (int) $_GET['group_id'];
session_write_close();
$group->purge($id);
print "Group {$id} purged.";
} else {
if (isset($_GET['action']) && $_GET['action'] == "5") {
$group->resetall();
print "All groups reset.";
} else {
if (isset($_GET['action']) && $_GET['action'] == "6") {
session_write_close();
示例2: sgDeleteGroup
public function sgDeleteGroup()
{
$this->checkPermissions($_POST['_wpnonce'], 'sg-delete-group');
$grObj = new Groups();
$grObj->returnMessages = true;
$result = $grObj->delete(['id' => $_POST['id']]);
$output['result'] = $result['result'];
$output['messages'] = $result['messages']['error'];
if ($output['result']) {
$valObj = new Values();
$valObj->delete(['group_id' => $_POST['id']]);
}
echo json_encode($output, JSON_UNESCAPED_UNICODE);
die;
}