-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.php
40 lines (35 loc) · 1.89 KB
/
helpers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
if (! function_exists('tgmpa')) {
/**
* Helper function to register a collection of required plugins.
*
* @since 2.0.0
* @api
*
* @param array $plugins An array of plugin arrays.
* @param array $config Optional. An array of configuration values.
*/
function tgmpa($plugins, $config = array())
{
$instance = call_user_func(array( get_class($GLOBALS['tgmpa']), 'get_instance' ));
foreach ($plugins as $plugin) {
call_user_func(array( $instance, 'register' ), $plugin);
}
if (! empty($config) && is_array($config)) {
// Send out notices for deprecated arguments passed.
if (isset($config['notices'])) {
_deprecated_argument(__FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.');
if (! isset($config['has_notices'])) {
$config['has_notices'] = $config['notices'];
}
}
if (isset($config['parent_menu_slug'])) {
_deprecated_argument(__FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.');
}
if (isset($config['parent_url_slug'])) {
_deprecated_argument(__FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.');
}
call_user_func(array( $instance, 'config' ), $config);
}
}
}