Elgg  Version 3.0
set_priority.php
Go to the documentation of this file.
1 <?php
13 $plugin_guid = (int) get_input('plugin_guid');
14 $priority = get_input('priority');
15 
17 
18 if (!$plugin instanceof ElggPlugin) {
19  return elgg_error_response(elgg_echo('admin:plugins:set_priority:no', [$plugin_guid]));
20 }
21 
22 if ($plugin->setPriority($priority) === false) {
23  $msg = $plugin->getError();
24  $string = ($msg) ? 'admin:plugins:set_priority:no_with_msg' : 'admin:plugins:set_priority:no';
25 
26  return elgg_error_response(elgg_echo($string, [$plugin->getDisplayName(), $msg]));
27 }
28 
29 // don't regenerate the simplecache because the plugin won't be
30 // loaded until next run. Just invalidate and let it regnerate as needed
32 
33 return elgg_ok_response();
$plugin_guid
Changes the load priority of a plugin.
$plugin
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
get_input($variable, $default=null, $filter_result=true)
Get some input from variables passed submitted through GET or POST.
Definition: input.php:27
elgg_error_response($error= '', $forward_url=REFERRER, $status_code=ELGG_HTTP_OK)
Prepare an error response to be returned by a page or an action handler.
elgg_ok_response($content= '', $message= '', $forward_url=null, $status_code=ELGG_HTTP_OK)
Prepares a successful response to be returned by a page or an action handler.
elgg_flush_caches()
Flush all the registered caches.
Definition: cache.php:234
$priority
get_entity($guid)
Loads and returns an entity object from a guid.
Definition: entities.php:87