本文整理汇总了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;
}