Merge pull request #7242 from Wachizungu/add-enable-taxonomy-tags-cake-command

new: [cli] enable all tags for a taxonomy
pull/7255/head
Andras Iklody 2021-03-24 22:22:00 +01:00 committed by GitHub
commit 09261f2481
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -189,6 +189,20 @@ class AdminShell extends AppShell
echo $message . PHP_EOL;
}
public function enableTaxonomyTags()
{
if (empty($this->args[0]) || !is_numeric($this->args[0])) {
echo 'Usage: ' . APP . '/cake ' . 'Admin enableTaxonomyTags [taxonomy_id]' . PHP_EOL;
} else {
$result = $this->Taxonomy->addTags(intval($this->args[0]));
if ($result) {
echo 'Taxonomy tags enabled' . PHP_EOL;
} else {
echo 'Could not enable taxonomy tags' . PHP_EOL;
}
}
}
public function updateWarningLists()
{
$this->ConfigLoad->execute();