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

回答編集履歴

2

補足の追加。

2017/07/18 09:10

投稿

kei344
kei344

スコア69625

answer CHANGED
@@ -1,3 +1,19 @@
1
1
  ``add_action('init', 'createPostType');`` は `$label, $postType` という引数を 関数createPostTypeに渡しません。
2
2
 
3
- 関数にまとめ物とは別に init用の関数を用意されてはいかがでしょう。
3
+ 関数にまとめ物とは別に init用の関数を用意されてはいかがでしょう。
4
+
5
+ ---
6
+
7
+ **追記:**
8
+
9
+ こういうことです。
10
+ ```PHP
11
+ function init_createPostType() {
12
+ createPostType( 'お客様情報1', 'customer1' );
13
+ createPostType( 'お客様情報2', 'customer2' );
14
+ createPostType( 'お客様情報3', 'customer3' );
15
+ createPostType( 'お客様情報4', 'customer4' );
16
+ createPostType( 'お客様情報5', 'customer5' );
17
+ }
18
+ add_action( 'init', 'init_createPostType' );
19
+ ```

1

読みやすく修正。

2017/07/18 09:10

投稿

kei344
kei344

スコア69625

answer CHANGED
@@ -1,3 +1,3 @@
1
1
  ``add_action('init', 'createPostType');`` は `$label, $postType` という引数を 関数createPostTypeに渡しません。
2
2
 
3
- 関数にまとめ物とは別に init用の関数を用意されてはいかがでしょう。
3
+ 関数にまとめ物とは別に init用の関数を用意されてはいかがでしょう。