-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-wp-addons.php
More file actions
27 lines (22 loc) · 794 Bytes
/
get-wp-addons.php
File metadata and controls
27 lines (22 loc) · 794 Bytes
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
<?php
$addOnList = require '.setup/wp-addons.php';
$addOnType = $argv[1];
$addOnAction = isset($argv[2]) ? $argv[2] : '';
$requestedList = [];
/*
For each defined action on each theme and plugin, return the command parameters to
install the files. The DB will have the settings for which ones are activated
'addon' : Install latest version of addon
['addon', '1.0'] : Install version 1.0 of addon
*/
$requestedList = $addOnAction ? $addOnList[$addOnType][$addOnAction] : $addOnList[$addOnType];
if(!empty($requestedList)){
foreach($requestedList as $key => $item){
if(is_array($item)){
if(!empty($item[1])){
$requestedList[$key] = "${item[0]} --version=${item[1]}";
}
}
}
}
echo implode("\n", $requestedList);