質問編集履歴
2
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,25 +42,19 @@
|
|
42
42
|
|
43
43
|
3)その際にタグ情報に提案日時(1月1日、1月2日、1月3日というように)を入力します
|
44
44
|
|
45
|
-
1)〜3)はできています。
|
46
|
-
|
47
|
-
---------------------
|
48
|
-
|
49
45
|
4)MWWPFormにてmwform_choices_mw-wp-form-xxxのフィルターフックを使い、タグ情報をラジオボタンの選択肢にしたいです
|
50
|
-
|
51
|
-
4)ができません。
|
52
46
|
|
53
47
|
|
54
48
|
|
49
|
+
1)〜3)はできています。
|
50
|
+
|
55
|
-
の
|
51
|
+
4)の関数がかけません。
|
52
|
+
|
53
|
+
|
56
54
|
|
57
55
|
|
58
56
|
|
59
57
|
###試したこと
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
58
|
|
65
59
|
|
66
60
|
|
1
こちらの不明点を明確にしたのと、コードを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -42,7 +42,13 @@
|
|
42
42
|
|
43
43
|
3)その際にタグ情報に提案日時(1月1日、1月2日、1月3日というように)を入力します
|
44
44
|
|
45
|
+
1)〜3)はできています。
|
46
|
+
|
47
|
+
---------------------
|
48
|
+
|
45
49
|
4)MWWPFormにてmwform_choices_mw-wp-form-xxxのフィルターフックを使い、タグ情報をラジオボタンの選択肢にしたいです
|
50
|
+
|
51
|
+
4)ができません。
|
46
52
|
|
47
53
|
|
48
54
|
|
@@ -71,3 +77,31 @@
|
|
71
77
|
カスタム投稿タイプ:daytime
|
72
78
|
|
73
79
|
MWWPFormにおいて[name]属性は'time'
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<?php
|
84
|
+
|
85
|
+
function add_products( $children, $atts ) {
|
86
|
+
|
87
|
+
if ( $atts['name'] == 'time' ) {
|
88
|
+
|
89
|
+
$times = get_posts( array('post_type' => 'daytime') );
|
90
|
+
|
91
|
+
foreach ( $times as $time ) {
|
92
|
+
|
93
|
+
$children[$time->post_title] = $time->post_title;
|
94
|
+
|
95
|
+
}
|
96
|
+
|
97
|
+
}
|
98
|
+
|
99
|
+
return $children;
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
add_filter( 'mwform_choices_mw-wp-form-380', 'add_products', 10, 2 );
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
カスタム投稿のタイトルを拾って、選択肢とするのは、参考URLを見ながらつくってみてできたんですが、複数のタグを選択肢にするのができません。
|