PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.2.10
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.2.10
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / src / App / Service / CategoriesService.php
wp-all-export / src / App / Service Last commit date
Addons 4 years ago License 4 years ago Pro 4 years ago VariationOptions 4 years ago CategoriesService.php 4 years ago ScheduledExport.php 4 years ago SnippetParser.php 4 years ago WooCommerceVersion.php 4 years ago
CategoriesService.php
32 lines
1 <?php
2
3 namespace Wpae\App\Service;
4
5
6 class CategoriesService
7 {
8 public function getTaxonomyHierarchy($parent = 0)
9 {
10 $termsConfig = array(
11 'taxonomy' => 'product_cat',
12 'hide_empty' => false,
13 'parent' => $parent
14 );
15
16 $terms = \get_categories($termsConfig);
17
18 $children = array();
19
20 foreach ($terms as $term) {
21
22 $item = array(
23 'id' => $term->term_id,
24 'title' => $term->name,
25 'children' => $this->getTaxonomyHierarchy($term->term_id)
26 );
27 $children[] = $item;
28 }
29
30 return $children;
31 }
32 }