{"id":20881,"date":"2016-12-04T05:20:22","date_gmt":"2016-12-04T05:20:22","guid":{"rendered":"http:\/\/contactform7.com\/?page_id=20881"},"modified":"2016-12-04T05:33:18","modified_gmt":"2016-12-04T05:33:18","slug":"getting-default-values-from-shortcode-attributes","status":"publish","type":"page","link":"https:\/\/contactform7.com\/ja\/getting-default-values-from-shortcode-attributes\/","title":{"rendered":"\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u5c5e\u6027\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"\n<p><code>[contact-form-7 ...]<\/code> \u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u5c5e\u6027\u5024\u3092\u30d5\u30a9\u30fc\u30e0\u3067\u4f7f\u3048\u305f\u3089\u4fbf\u5229\u306a\u306e\u306b\u3001\u3068\u601d\u3046\u3053\u3068\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3093\u306a\u6642\u306f<a href=\"http:\/\/contactform7.com\/ja\/tag-syntax\/\">\u30d5\u30a9\u30fc\u30e0\u30bf\u30b0<\/a>\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3057\u3066 <code>default:shortcode_attr<\/code> \u3092\u30bb\u30c3\u30c8\u3057\u307e\u3057\u3087\u3046\u3002\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u5c5e\u6027\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3068\u3057\u3066\u3001\u5b9b\u5148\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u305f\u3081\u306e &#8220;destination-email&#8221; \u3068\u3044\u3046\u540d\u524d\u306e\u5165\u529b\u9805\u76ee\u304c\u3042\u308b\u3068\u3057\u307e\u3057\u3087\u3046:<\/p>\n<pre><code>[email* destination-email]<\/code><\/pre>\n<p>\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u5c5e\u6027\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u5f97\u308b\u305f\u3081\u306b\u3001\u3053\u306e\u30d5\u30a9\u30fc\u30e0\u30bf\u30b0\u306b <code>default:shortcode_attr<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059:<\/p>\n<pre><code>[email* destination-email <strong>default:shortcode_attr<\/strong>]<\/code><\/pre>\n<p>\u305d\u308c\u304b\u3089\u3001\u5165\u529b\u9805\u76ee\u3068\u540c\u3058\u540d\u524d(\u3053\u306e\u5834\u5408\u306f &#8220;destination-email&#8221;)\u306e\u5c5e\u6027\u3092\u30b3\u30f3\u30bf\u30af\u30c8\u30d5\u30a9\u30fc\u30e0\u306e\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306b\u8ffd\u52a0\u3057\u307e\u3059:<\/p>\n<pre><code>[contact-form-7 id=\"123\" title=\"Contact Form\" <strong>destination-email=\"xxxxxx@example.com\"<\/strong>]<\/code><\/pre>\n<p>\u3053\u308c\u3067\u5168\u90e8? \u6b8b\u5ff5\u306a\u304c\u3089\u3082\u3046\u4e00\u3064\u5fc5\u8981\u306a\u30b9\u30c6\u30c3\u30d7\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u901a\u5e38\u3001WordPress \u306e\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306f\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3055\u308c\u305f\u5c5e\u6027\u3057\u304b\u53d6\u3089\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u306a\u306e\u3067\u524d\u3082\u3063\u3066\u4f7f\u7528\u3059\u308b\u5c5e\u6027\u3092\u767b\u9332\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30c6\u30fc\u30de\u306e functions.php \u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nadd_filter( 'shortcode_atts_wpcf7', 'custom_shortcode_atts_wpcf7_filter', 10, 3 );\r\n\r\nfunction custom_shortcode_atts_wpcf7_filter( $out, $pairs, $atts ) {\r\n\t$my_attr = 'destination-email';\r\n\r\n\tif ( isset( $atts&#x5B;$my_attr] ) ) {\r\n\t\t$out&#x5B;$my_attr] = $atts&#x5B;$my_attr];\r\n\t}\r\n\r\n\treturn $out;\r\n}\r\n<\/pre>\n<p>\u3053\u308c\u3067\u5168\u90e8\u3067\u3059! \u9805\u76ee\u306b &#8220;xxxxxx@example.com&#8221; \u304c\u5165\u529b\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u30a8\u30e9\u30fc: \u30b3\u30f3\u30bf\u30af\u30c8\u30d5\u30a9\u30fc\u30e0\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 \u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u5c5e\u6027\u5024\u3092\u30d5\u30a9\u30fc\u30e0\u3067\u4f7f\u3048\u305f\u3089\u4fbf\u5229\u306a\u306e\u306b\u3001\u3068\u601d\u3046\u3053\u3068\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002 \u305d\u3093\u306a\u6642\u306f\u30d5\u30a9\u30fc\u30e0\u30bf\u30b0\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3057\u3066 default:shortcode_att &hellip; <a href=\"https:\/\/contactform7.com\/ja\/getting-default-values-from-shortcode-attributes\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u5c5e\u6027\u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u53d6\u5f97\u3059\u308b<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_locale":"ja","_original_post":"20877","footnotes":""},"class_list":["post-20881","page","type-page","status-publish","hentry","ja"],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/pages\/20881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/comments?post=20881"}],"version-history":[{"count":0,"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/pages\/20881\/revisions"}],"wp:attachment":[{"href":"https:\/\/contactform7.com\/wp-json\/wp\/v2\/media?parent=20881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}