Elgg  Version master
plugins.php
Go to the documentation of this file.
1 <?php
16  return _elgg_services()->plugins->get($plugin_id);
17 }
18 
31 function elgg_plugin_exists(string $plugin_id): bool {
32  return _elgg_services()->plugins->exists($plugin_id);
33 }
34 
43 function elgg_is_active_plugin(string $plugin_id): bool {
44  return _elgg_services()->plugins->isActive($plugin_id);
45 }
46 
55 function elgg_get_plugins(string $status = 'active'): array {
56  return _elgg_services()->plugins->find($status);
57 }
58 
71 function elgg_get_plugin_user_setting(string $name, int $user_guid = 0, string $plugin_id = '', $default = null) {
72  $user = _elgg_services()->entityTable->getUserForPermissionsCheck($user_guid);
73  if (!$user instanceof ElggUser) {
74  return $default;
75  }
76 
77  return $user->getPluginSetting($plugin_id, $name, $default);
78 }
79 
91 function elgg_get_plugin_setting(string $name, string $plugin_id, $default = null) {
92  $plugin = _elgg_services()->plugins->get($plugin_id);
93  if (!$plugin) {
94  return false;
95  }
96 
97  return $plugin->getSetting($name, $default);
98 }
$default
Definition: checkbox.php:30
elgg_get_plugins(string $status= 'active')
Returns an ordered list of plugins.
Definition: plugins.php:55
$user_guid
Definition: login_as.php:10
$plugin
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:43
$user
Definition: ban.php:7
elgg_get_plugin_setting(string $name, string $plugin_id, $default=null)
Get setting for a plugin.
Definition: plugins.php:91
_elgg_services()
Get the global service provider.
Definition: elgglib.php:351
elgg_plugin_exists(string $plugin_id)
Returns if a plugin exists in the system.
Definition: plugins.php:31
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:71