Есть код который меня игнорирует
$args = array(
'hide_empty' => 1,
'parent' => (int)$childcat->term_id,
'post_status' => 'publish',
'hierarchical' => 0,
'orderby' => 'name',
//'order' => 'DESC',
'pad_counts' => false
);
$termchildren = get_terms('product_cat', $args);
Получаем
Блендеры
Кухонные комбайны
Мультиварки
Мясорубки
Плиты
СВЧ-печи
Соковыжималки
Хлебопечки
Чайники и термопоты
а потом бах и Блинница
в глаза бросились проблемы с О, Б, В, С, Х, Я, Т ...
array(18) {
[0]=>
object(stdClass)#7085 (13) {
["term_id"]=>
string(3) "327"
["name"]=>
string(16) "Блендеры"
["slug"]=>
string(12) "blendery-327"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(3) "327"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(15)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[1]=>
object(stdClass)#7084 (13) {
["term_id"]=>
string(2) "48"
["name"]=>
string(33) "Кухонные комбайны"
["slug"]=>
string(20) "kuhonnye-kombayny-48"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "48"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(10)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[2]=>
object(stdClass)#7083 (13) {
["term_id"]=>
string(2) "51"
["name"]=>
string(22) "Мультиварки"
["slug"]=>
string(12) "parovarki-51"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "51"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(10)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[3]=>
object(stdClass)#7082 (13) {
["term_id"]=>
string(2) "50"
["name"]=>
string(18) "Мясорубки"
["slug"]=>
string(13) "myasorubki-50"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "50"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(10)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[4]=>
object(stdClass)#7081 (13) {
["term_id"]=>
string(2) "17"
["name"]=>
string(10) "Плиты"
["slug"]=>
string(8) "plity-17"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "17"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(2)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[5]=>
object(stdClass)#7080 (13) {
["term_id"]=>
string(2) "49"
["name"]=>
string(15) "СВЧ-печи"
["slug"]=>
string(22) "mikrovolnovye-pechi-49"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "49"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(11)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[6]=>
object(stdClass)#7079 (13) {
["term_id"]=>
string(2) "52"
["name"]=>
string(26) "Соковыжималки"
["slug"]=>
string(17) "sokovyzhimalki-52"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "52"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(6)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[7]=>
object(stdClass)#7078 (13) {
["term_id"]=>
string(2) "53"
["name"]=>
string(20) "Хлебопечки"
["slug"]=>
string(14) "hlebopechki-53"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "53"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(4)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[8]=>
object(stdClass)#7077 (13) {
["term_id"]=>
string(2) "54"
["name"]=>
string(36) "Чайники и термопоты"
["slug"]=>
string(18) "elektrochayniki-54"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(2) "54"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(19)
["meta_id"]=>
NULL
["woocommerce_term_id"]=>
NULL
["meta_key"]=>
NULL
["meta_value"]=>
NULL
}
[9]=>
object(stdClass)#7076 (13) {
["term_id"]=>
string(9) "100000222"
["name"]=>
string(16) "Блинница"
["slug"]=>
string(9) "blinnitsa"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000222"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(1)
["meta_id"]=>
string(4) "1008"
["woocommerce_term_id"]=>
string(9) "100000222"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
[10]=>
object(stdClass)#7075 (13) {
["term_id"]=>
string(9) "100000220"
["name"]=>
string(8) "Весы"
["slug"]=>
string(4) "vesy"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000220"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(2)
["meta_id"]=>
string(4) "1004"
["woocommerce_term_id"]=>
string(9) "100000220"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
[11]=>
object(stdClass)#7074 (13) {
["term_id"]=>
string(9) "100000273"
["name"]=>
string(20) "Йогуртницы"
["slug"]=>
string(11) "jogurtnitsy"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000273"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(2)
["meta_id"]=>
string(4) "1116"
["woocommerce_term_id"]=>
string(9) "100000273"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
[12]=>
object(stdClass)#7073 (13) {
["term_id"]=>
string(9) "100000152"
["name"]=>
string(20) "Кофемашины"
["slug"]=>
string(11) "kofemashiny"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000152"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(8)
["meta_id"]=>
string(3) "847"
["woocommerce_term_id"]=>
string(9) "100000152"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
[13]=>
object(stdClass)#7072 (13) {
["term_id"]=>
string(9) "100000277"
["name"]=>
string(18) "Кофемолки"
["slug"]=>
string(9) "kofemolki"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000277"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(3)
["meta_id"]=>
string(4) "1124"
["woocommerce_term_id"]=>
string(9) "100000277"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
[14]=>
object(stdClass)#7071 (13) {
["term_id"]=>
string(9) "100000155"
["name"]=>
string(14) "Миксеры"
["slug"]=>
string(7) "miksery"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000155"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(3)
["meta_id"]=>
string(3) "859"
["woocommerce_term_id"]=>
string(9) "100000155"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
[15]=>
object(stdClass)#7070 (13) {
["term_id"]=>
string(9) "100000157"
["name"]=>
string(17) "Мини-печи"
["slug"]=>
string(10) "mini-pechi"
["term_group"]=>
string(1) "0"
["term_taxonomy_id"]=>
string(9) "100000157"
["taxonomy"]=>
string(11) "product_cat"
["description"]=>
string(0) ""
["parent"]=>
string(2) "46"
["count"]=>
int(1)
["meta_id"]=>
string(3) "871"
["woocommerce_term_id"]=>
string(9) "100000157"
["meta_key"]=>
string(5) "order"
["meta_value"]=>
string(1) "0"
}
}
Понимаю что проблема с UTF но не могу догнать как решить