aboutsummaryrefslogtreecommitdiff
path: root/actions/widgets/delete.php
blob: 5b8aaf75ea704777d79ed7e616f2166d41426441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
/**
 * Elgg widget delete action
 *
 * @package Elgg.Core
 * @subpackage Widgets.Management
 */

$guid = get_input('guid');

$user = elgg_get_logged_in_user_entity();

$widget = get_entity($guid);
if ($widget && $user->canEdit() && $widget->delete()) {
	forward(REFERER);
}

register_error(elgg_echo('widgets:remove:failure'));
forward(REFERER);