回答編集履歴

3

修正

2022/03/02 12:59

投稿

KazuhiroHatano
KazuhiroHatano

スコア7804

test CHANGED
@@ -2,7 +2,7 @@
2
2
  ```php
3
3
  add_filter('get_terms_defaults',function($query_vars,$taxonomies){
4
4
  if(in_array('post_tag',$taxonomies)){
5
- $query_vars['order_by']='term_order';
5
+ $query_vars['orderby']='term_order';
6
6
  }
7
7
  return $query_vars;
8
8
  },10,2);

2

修正

2022/03/02 10:02

投稿

KazuhiroHatano
KazuhiroHatano

スコア7804

test CHANGED
@@ -1,7 +1,9 @@
1
1
 
2
2
  ```php
3
3
  add_filter('get_terms_defaults',function($query_vars,$taxonomies){
4
+ if(in_array('post_tag',$taxonomies)){
4
- if(in_array('post_tag',$taxonomies)){$query_vars['order_by']='term_order';}
5
+ $query_vars['order_by']='term_order';
6
+ }
5
7
  return $query_vars;
6
8
  },10,2);
7
9
  ```

1

修正

2022/03/02 10:02

投稿

KazuhiroHatano
KazuhiroHatano

スコア7804

test CHANGED
@@ -2,5 +2,6 @@
2
2
  ```php
3
3
  add_filter('get_terms_defaults',function($query_vars,$taxonomies){
4
4
  if(in_array('post_tag',$taxonomies)){$query_vars['order_by']='term_order';}
5
+ return $query_vars;
5
6
  },10,2);
6
7
  ```