{"id":185520,"date":"2016-01-30T19:40:51","date_gmt":"2016-01-30T10:40:51","guid":{"rendered":"https:\/\/ja.wordpress.org\/support\/2016\/01\/30\/mw-wp-form-%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%83%88%e3%83%9c%e3%83%83%e3%82%af%e3%82%b9%e3%81%ae%e9%80%a3%e5%8b%95\/"},"modified":"2016-09-28T06:10:51","modified_gmt":"2016-09-27T21:10:51","slug":"mw-wp-form-%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%83%88%e3%83%9c%e3%83%83%e3%82%af%e3%82%b9%e3%81%ae%e9%80%a3%e5%8b%95","status":"closed","type":"topic","link":"https:\/\/ja.wordpress.org\/support\/topic\/mw-wp-form-%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%83%88%e3%83%9c%e3%83%83%e3%82%af%e3%82%b9%e3%81%ae%e9%80%a3%e5%8b%95\/","title":{"rendered":"MW WP Form \u306e\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u9023\u52d5"},"content":{"rendered":"<p>MW WP Form\u3067\u3001\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u300cproduct\u300d\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u300cesProduct\u300d\u300cesPrice\u300d\u305d\u308c\u305e\u308c\u306e\u5024\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u300cmwform_choices_mw-wp-form-xxx\u300d\u3092\u4f7f\u3063\u3066<br \/>\n\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u9078\u629e\u80a2\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><code>function add_products( $children, $atts ) {\n    if ( $atts[&#039;name&#039;] == &#039;products&#039; ) {\n        $products = get_posts( array(\n            &#039;post_type&#039; =&gt; &#039;product&#039;,\n            &#039;posts_per_page&#039; =&gt; -1\n        ) );\n        foreach ( $products as $product ) {\n            $children[$product-&gt;esProduct] = $product-&gt;esProduct;\n        }\n    }\n    return $children;\n}\nadd_filter( &#039;mwform_choices_mw-wp-form-444&#039;, &#039;add_products&#039;, 10, 2 );\n\nfunction add_price( $children, $atts ) {\n    if ( $atts[&#039;name&#039;] == &#039;prices&#039; ) {\n        $prices = get_posts( array(\n            &#039;post_type&#039; =&gt; &#039;product&#039;,\n            &#039;posts_per_page&#039; =&gt; -1\n        ) );\n        foreach ( $prices as $price ) {\n            $children[$price-&gt;esPrice] = $price-&gt;esPrice;\n        }\n    }\n    return $children;\n}\nadd_filter( &#039;mwform_choices_mw-wp-form-444&#039;, &#039;add_price&#039;, 10, 2 );<\/code><\/pre>\n<p>\u300cesProduct\u300d\u3067\u9078\u629e\u3057\u305f\u5024\u306b\u5fdc\u3058\u3066\u300cesPrice\u300d\u306e\u5024\u304c\u9078\u629e\u3055\u308c\u308b\u3068\u3044\u3046\u3088\u3046\u306b\u3001\u3053\u306e\uff12\u3064\u306e\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u9023\u52d5\u3055\u305b\u308b\u3088\u3046\u306a\u3053\u3068\u306f\u3067\u304d\u308b\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n\u300cesPrice\u300d\u306e\u65b9\u306f\u3001\u9023\u52d5\u3057\u305f\u5024\u304c\u8868\u793a\u3067\u304d\u308c\u3070\u826f\u3044\u306e\u3067\u3001\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306b\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u6c17\u3082\u3057\u307e\u3059\u304c\u3001\u4f55\u304b\u826f\u3044\u65b9\u6cd5\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n","protected":false},"template":"","class_list":["post-185520","topic","type-topic","status-closed","hentry","topic-tag-14327","topic-tag-21351","topic-tag-18682","topic-tag-mw-wp-form"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/185520","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/185520\/revisions"}],"wp:attachment":[{"href":"https:\/\/ja.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=185520"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}