PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / trunk
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel vtrunk
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 2 years ago License 1 year ago Pro 2 years ago VariationOptions 2 years ago CategoriesService.php 5 years ago ScheduledExport.php 4 weeks ago SnippetParser.php 8 years ago WooCommerceVersion.php 8 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 }