質問するログイン新規登録

質問編集履歴

2

文法の修正

2017/04/09 02:44

投稿

alesta
alesta

スコア16

title CHANGED
File without changes
body CHANGED
@@ -59,6 +59,7 @@
59
59
 
60
60
  $wp_query->query_vars['author'] = $current_user->ID;
61
61
  }
62
+ add_action('pre_get_posts', 'hide_other_posts');
62
63
  ```
63
64
  ###試したこと
64
65
  自身の投稿を表示させないコードを探してfunction.phpに記述した。

1

書式の改善

2017/04/09 02:44

投稿

alesta
alesta

スコア16

title CHANGED
File without changes
body CHANGED
@@ -40,6 +40,10 @@
40
40
  }
41
41
  add_action('pre_get_posts', 'hide_other_posts');
42
42
 
43
+ /*-------------------------------------------*/
44
+ /* ここからwelcart用に記述したコード
45
+ /*-------------------------------------------*/
46
+
43
47
  // 自分が投稿した商品だけ管理画面(商品マスターのページ)で表示する
44
48
  function filter_other_post( $wp_query ) {
45
49
  global $pagenow, $current_user;