回答編集履歴

2

追記

2017/06/20 06:59

投稿

ttyp03
ttyp03

スコア16998

test CHANGED
@@ -13,3 +13,35 @@
13
13
  }
14
14
 
15
15
  ```
16
+
17
+
18
+
19
+ もう一案。
20
+
21
+ 上記のような処理を関数化。
22
+
23
+ ```PHP
24
+
25
+ $tag = GetTermTaxonomyIdTag(10,23,42);
26
+
27
+
28
+
29
+ function GetTermTaxonomyIdTag($ids)
30
+
31
+ {
32
+
33
+ $args = func_get_args();
34
+
35
+ foreach($args as $id){
36
+
37
+ $tag[] = get_term_by('term_taxonomy_id',$id);
38
+
39
+ }
40
+
41
+ return $tag;
42
+
43
+ }
44
+
45
+
46
+
47
+ ```

1

変数名変更

2017/06/20 06:59

投稿

ttyp03
ttyp03

スコア16998

test CHANGED
@@ -6,9 +6,9 @@
6
6
 
7
7
  $ids = array(10,23,42);
8
8
 
9
- foreach($ids as $value){
9
+ foreach($ids as $id){
10
10
 
11
- $tag[] = get_term_by('term_taxonomy_id',$value);
11
+ $tag[] = get_term_by('term_taxonomy_id',$id);
12
12
 
13
13
  }
14
14