Elgg  Version master
plugins.php
Go to the documentation of this file.
1 <?php
16  return _elgg_services()->plugins->get($plugin_id);
17 }
18 
27 function elgg_is_active_plugin(string $plugin_id): bool {
28  return _elgg_services()->plugins->isActive($plugin_id);
29 }
30 
39 function elgg_get_plugins(string $status = 'active'): array {
40  return _elgg_services()->plugins->find($status);
41 }
42 
55 function elgg_get_plugin_user_setting(string $name, int $user_guid = 0, string $plugin_id = '', $default = null) {
56  $user = _elgg_services()->entityTable->getUserForPermissionsCheck($user_guid);
57  if (!$user instanceof \ElggUser) {
58  return $default;
59  }
60 
61  return $user->getPluginSetting($plugin_id, $name, $default);
62 }
63 
75 function elgg_get_plugin_setting(string $name, string $plugin_id, $default = null) {
76  $plugin = _elgg_services()->plugins->get($plugin_id);
77  if (!$plugin instanceof \ElggPlugin) {
78  return $default;
79  }
80 
81  return $plugin->getSetting($name, $default);
82 }
$default
Definition: checkbox.php:30
elgg_get_plugins(string $status= 'active')
Returns an ordered list of plugins.
Definition: plugins.php:39
$user_guid
Definition: login_as.php:10
$plugin
Plugin class containing helper functions for plugin activation/deactivation, dependency checking capa...
Definition: ElggPlugin.php:17
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
elgg_get_plugin_from_id(string $plugin_id)
Elgg plugins library Contains functions for managing plugins.
Definition: plugins.php:15
$plugin_id
Remove all user and plugin settings from the give plugin ID.
Definition: remove.php:8
elgg_is_active_plugin(string $plugin_id)
Returns if a plugin is active for a current site.
Definition: plugins.php:27
$user
Definition: ban.php:7
elgg_get_plugin_setting(string $name, string $plugin_id, $default=null)
Get setting for a plugin.
Definition: plugins.php:75
_elgg_services()
Get the global service provider.
Definition: elgglib.php:351
elgg_get_plugin_user_setting(string $name, int $user_guid=0, string $plugin_id= '', $default=null)
Get a user specific setting for a plugin.
Definition: plugins.php:55