Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何获取WooCommerce的所有父类别_Php_Wordpress_Content Management System - Fatal编程技术网

Php 如何获取WooCommerce的所有父类别

Php 如何获取WooCommerce的所有父类别,php,wordpress,content-management-system,Php,Wordpress,Content Management System,仅获取WooCommerce中的所有父类别,无帖子id。您可以使用Get\u术语作为: $terms = get_terms(['taxonomy' => 'product_cat','hide_empty' => false, 'parent' => 0]); 希望这能有所帮助。最后是一些简单有效的答案。。。

仅获取WooCommerce中的所有父类别,无帖子id。

您可以使用Get\u术语作为:

$terms = get_terms(['taxonomy' => 'product_cat','hide_empty' => false, 'parent' => 0]);

希望这能有所帮助。

最后是一些简单有效的答案。。。