回答編集履歴
1
コードを WP 4.5.0以上に対応
test
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
-
のすべてについて、「説明」欄にこの対象グループを特定できる共通のワード(例えば target)を入れておくと、[get_terms](http://
|
17
|
+
のすべてについて、「説明」欄にこの対象グループを特定できる共通のワード(例えば target)を入れておくと、[get_terms](https://developer.wordpress.org/reference/functions/get_terms/) の引数で 'description__like' を指定することでまとめて取得することが可能です。
|
18
18
|
|
19
19
|
|
20
20
|
|
@@ -34,12 +34,14 @@
|
|
34
34
|
|
35
35
|
$args = array(
|
36
36
|
|
37
|
+
'taxonomy' => $taxonomies,
|
38
|
+
|
37
39
|
'hide_empty' => false,
|
38
40
|
|
39
41
|
'description__like' => 'target',
|
40
42
|
|
41
43
|
);
|
42
44
|
|
43
|
-
$terms = get_terms( $
|
45
|
+
$terms = get_terms( $args );
|
44
46
|
|
45
47
|
```
|