回答編集履歴
1
コードを WP 4.5.0以上に対応
answer
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
> ➁「noun」の、「ja」の子ターム
|
7
7
|
> ➂「adjective」の、「ja」の子ターム
|
8
8
|
|
9
|
-
のすべてについて、「説明」欄にこの対象グループを特定できる共通のワード(例えば target)を入れておくと、[get_terms](
|
9
|
+
のすべてについて、「説明」欄にこの対象グループを特定できる共通のワード(例えば target)を入れておくと、[get_terms](https://developer.wordpress.org/reference/functions/get_terms/) の引数で 'description__like' を指定することでまとめて取得することが可能です。
|
10
10
|
|
11
11
|
```php
|
12
12
|
<?php
|
@@ -16,8 +16,9 @@
|
|
16
16
|
'adjective',
|
17
17
|
);
|
18
18
|
$args = array(
|
19
|
+
'taxonomy' => $taxonomies,
|
19
20
|
'hide_empty' => false,
|
20
21
|
'description__like' => 'target',
|
21
22
|
);
|
22
|
-
$terms = get_terms( $
|
23
|
+
$terms = get_terms( $args );
|
23
24
|
```
|