{"id":158,"date":"2022-10-30T02:11:00","date_gmt":"2022-10-29T17:11:00","guid":{"rendered":"http:\/\/52.196.21.54.nip.io\/techblog\/?p=158"},"modified":"2022-10-27T02:14:51","modified_gmt":"2022-10-26T17:14:51","slug":"mts-simple-booking%e3%81%a7%e4%ba%88%e7%b4%84%e5%93%81%e7%9b%ae%e3%81%94%e3%81%a8%e3%81%ab%e7%95%b0%e3%81%aa%e3%82%8b%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%82%92%e8%a1%8c%e3%81%86","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2022\/10\/30\/158\/","title":{"rendered":"MTS Simple Booking\u3067\u4e88\u7d04\u54c1\u76ee\u3054\u3068\u306b\u7570\u306a\u308b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u884c\u3046\u65b9\u6cd5"},"content":{"rendered":"\n<p>WordPress\u30d7\u30e9\u30b0\u30a4\u30f3\u306eMTS Simple Booking\u30d3\u30b8\u30cd\u30b9\u7248\u3067\u306f\u3001\u8a2d\u5b9a\u753b\u9762\u304b\u3089\u884c\u3046\u8a2d\u5b9a\u306e\u307b\u304b\u306b\u3001\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u67d4\u8edf\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u3060\u3002<br>\u57fa\u672c\u7684\u306b\u306f\u958b\u767a\u8005\u306eWeb\u30b5\u30a4\u30c8\u3092\u898b\u306a\u304c\u3089\u66f8\u3051\u3070\u3044\u3044\u306e\u3060\u304c\u3001\u3053\u3053\u3067\u306f\u60a9\u307f\u3084\u3059\u3044\u4e88\u7d04\u54c1\u76ee\u3054\u3068\u306b\u7570\u306a\u308b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u884c\u3046\u65b9\u6cd5\u3092\u7d39\u4ecb\u3059\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">jQuery\u7de8<\/h2>\n\n\n\n<p>jQuery\u3092\u4f7f\u3063\u3066\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306e\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u305f\u3044\u3053\u3068\u304c\u3042\u308b\u3002<br>\u4f8b\u3048\u3070\u300c\u65b0\u898f\u5229\u7528\u300d\u3067\u300c\u306f\u3044\u300d\u3092\u9078\u3093\u3060\u6642\u3060\u3051\u8868\u793a\u3055\u308c\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8868\u793a\u3059\u308b\u306a\u3069\u3059\u308b\u3068\u304d\u3068\u304b\u3002<br>\u305d\u3093\u306a\u6642\u307e\u305a\u306f\u6b21\u306e\u3088\u3046\u306a\u5909\u6570\u3092\u7528\u610f\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const aid = $('&#91;name=\"booking&#91;article_id]\"]').val(); \/\/ \u73fe\u5728\u306e\u4e88\u7d04\u54c1\u76eeID\u3092\u53d6\u5f97\nconst custom_aid = &#91;'10', '11', '12']; \/\/ \u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3044\u4e88\u7d04\u54c1\u76eeID<\/code><\/pre>\n\n\n\n<p>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u30b3\u30fc\u30c9\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u66f8\u304f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if( custom_aid.includes(aid) ){\n\n    \/\/ \u3053\u306e\u4e2d\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304f\n\n}<\/code><\/pre>\n\n\n\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001<code>subscription<\/code>\u30da\u30fc\u30b8\u3067\u306f\u4f7f\u3048\u306a\u3044\u3068\u3044\u3046\u306e\u304c\u3042\u308b\u3002<br>\u4ee3\u308f\u308a\u306e\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u3060\u308d\u3046\u304b\uff1f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const custom_regexp = \/\u4e88\u7d04\u54c1\u76ee\u540d1|\u4e88\u7d04\u54c1\u76ee\u540d2|\u4e88\u7d04\u54c1\u76ee\u540d3\/g;\n\nif( custom_regexp.test( $('.subscription-header .subscription-title').text() ) ){\n\n    \/\/ \u3053\u306e\u4e2d\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304f\n\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">PHP\uff08\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\uff09\u7de8<\/h2>\n\n\n\n<p>MTS Simple Booking\u30d3\u30b8\u30cd\u30b9\u7248\u3067\u306f\u3055\u307e\u3056\u307e\u306a\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u300c\u304a\u540d\u524d\u300d\u3092\u300c\u62c5\u5f53\u8005\u540d\u300d\u306b\u66f8\u304d\u63db\u3048\u308b\u307f\u305f\u3044\u306a\u3053\u3068\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u3002<br>\u5909\u6570\u306e\u7528\u610f\u306f\u6b21\u306e\u3068\u304a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u4e88\u7d04\u54c1\u76eeID\n$custom_aid = array(10,11,12);\n\n\/\/ MTSSB \u4e88\u7d04\u54c1\u76eeID\u306e\u4fdd\u7ba1\nfunction mtssb_set_article_id($aid) {\n    global $mtssb_article_id;\n    if ( !empty($aid) ) {\n        $mtssb_article_id = $aid;\n    }\n}\nadd_filter('booking_form_set_article_id', 'mtssb_set_article_id');<\/code><\/pre>\n\n\n\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067<code>$mtssb_article_id<\/code>\u3067\u73fe\u5728\u306e\u4e88\u7d04\u54c1\u76eeID\u304c\u3001<code>$custom_aid<\/code>\u3067\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3044\u4e88\u7d04\u54c1\u76eeID\u304c\u308f\u304b\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002<br>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u30b3\u30fc\u30c9\u306e\u4f8b\u306f\u3053\u3093\u306a\u611f\u3058\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u4eba\u6570\u30e9\u30d9\u30eb\u306e\u5909\u66f4\nfunction form_count_label($str) {\n    global $mtssb_article_id, $custom_aid;\n    if ( in_array( $mtssb_article_id, $custom_aid, false ) &amp;&amp; $str == '\u5927\u4eba') {\n        return '18\u6b73\u4ee5\u4e0a';\n    } elseif ( in_array( $mtssb_article_id, $custom_aid, false ) &amp;&amp; $str == '\u5c0f\u4eba') {\n        return '18\u6b73\u672a\u6e80';\n    } else {\n        return $str;\n    }\n}\nadd_filter('booking_form_count_label', 'form_count_label');<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30e1\u30fc\u30eb\u306e\u6587\u9762<\/h3>\n\n\n\n<p>\u30e1\u30fc\u30eb\u306e\u6587\u9762\u306f\u8a2d\u5b9a\u753b\u9762\u304b\u3089\u3082\u7de8\u96c6\u3067\u304d\u308b\u304c\u3001\u4e88\u7d04\u54c1\u76ee\u3054\u3068\u306b\u5185\u5bb9\u3092\u5909\u3048\u308b\u6642\u306f\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u306e\u51fa\u756a\u3060\u3002<br>\u4e88\u7d04\u30e1\u30fc\u30eb\u306e\u5f8c\u6587\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8ffd\u52a0\u3059\u308b\u6642\u306e\u4f8b\u304c\u3053\u3061\u3089\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function booking_mail_footer($str, $status) {\n    global $custom_aid;\n    if ( in_array( $status&#91;'article_id'], $custom_aid, false ) ) {\n        $message = &lt;&lt;&lt;EOF\n        \uff08\u6ce81\uff09\u3053\u3053\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u5165\u308a\u307e\u3059\u3002\n        \uff08\u6ce82\uff09\u3053\u3053\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u5165\u308a\u307e\u3059\u3002\n        \uff08\u6ce83\uff09\u3053\u3053\u306b\u30c6\u30ad\u30b9\u30c8\u304c\u5165\u308a\u307e\u3059\u3002\n        EOF;\n        return $message . $str;\n    } else {\n        return $str;\n    }\n}\nadd_filter('mtssb_mail_booking_footer', 'booking_mail_footer', 10, 2);<\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067\u306f2\u3064\u76ee\u306e\u5f15\u6570<code>$status['article_id']<\/code>\u3067\u73fe\u5728\u306e\u4e88\u7d04\u54c1\u76eeID\u304c\u53d6\u308c\u308b\u3002<br>\u6ce8\u610f\u70b9\u306fPayPal\u6c7a\u6e08\u306e\u305f\u3081\u4ed6\u30da\u30fc\u30b8\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3068\u3001\u73fe\u5728\u306e\u4e88\u7d04\u54c1\u76eeID\u304c\u5931\u308f\u308c\u3066\u3057\u307e\u3046\u4e8b\u3002<br>\u4ee3\u66ff\u6848\u3082\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u4eca\u306e\u3068\u3053\u308d<strong>PayPal\u6c7a\u6e08\u4f7f\u7528\u6642\u306b\u30e1\u30fc\u30eb\u6587\u9762\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u4e8b\u306f\u3067\u304d\u306a\u3044<\/strong>\u3068\u3044\u3046\u4e8b\u306b\u306a\u308b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"http:\/\/mtssb.mt-systems.jp\/blog\/ver-1-9-\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30b0\u30eb\u30fc\u30d7\u8a2d\u5b9a\/\" data-type=\"URL\" data-id=\"http:\/\/mtssb.mt-systems.jp\/blog\/ver-1-9-\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30b0\u30eb\u30fc\u30d7\u8a2d\u5b9a\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ver.1.9 \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30b0\u30eb\u30fc\u30d7\u8a2d\u5b9a<\/a><\/li><li><a href=\"http:\/\/mtssb.mt-systems.jp\/documentation\/wordpress\u304c\u521d\u3081\u3066\u306e\u65b9\/\u6a5f\u80fd\u30ac\u30a4\u30c9\/\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\u30a3\u30eb\u30bf\u30fc\/\" data-type=\"URL\" data-id=\"http:\/\/mtssb.mt-systems.jp\/documentation\/wordpress\u304c\u521d\u3081\u3066\u306e\u65b9\/\u6a5f\u80fd\u30ac\u30a4\u30c9\/\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\u30a3\u30eb\u30bf\u30fc\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\u30a3\u30eb\u30bf\u30fc<\/a><\/li><li><a href=\"http:\/\/mtssb.mt-systems.jp\/blog\/\u4e88\u7d04\u30e1\u30fc\u30eb\u6587\u306e\u524d\u5f8c\u306b\u6587\u3092\u633f\u5165\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\/\" data-type=\"URL\" data-id=\"http:\/\/mtssb.mt-systems.jp\/blog\/\u4e88\u7d04\u30e1\u30fc\u30eb\u6587\u306e\u524d\u5f8c\u306b\u6587\u3092\u633f\u5165\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\/\" target=\"_blank\" rel=\"noreferrer noopener\">\u4e88\u7d04\u30e1\u30fc\u30eb\u6587\u306e\u524d\u5f8c\u306b\u6587\u3092\u633f\u5165\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\u30a3\u30eb\u30bf\u30fc<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"WordPress\u30d7\u30e9\u30b0\u30a4\u30f3\u306eMTS Simple Booking\u30d3\u30b8\u30cd\u30b9\u7248\u3067\u306f\u3001\u8a2d\u5b9a\u753b\u9762\u304b\u3089\u884c\u3046\u8a2d\u5b9a\u306e\u307b\u304b\u306b\u3001\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u67d4\u8edf\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u53ef\u80fd\u3060\u3002\u57fa\u672c\u7684\u306b\u306f\u958b\u767a\u8005\u306eWeb\u30b5\u30a4\u30c8\u3092\u898b\u306a\u304c\u3089\u66f8\u3051\u3070\u3044\u3044\u306e\u3060\u304c\u3001 [&hellip;]","protected":false},"author":1,"featured_media":159,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[39,47],"tags":[59,60,53,52,10],"class_list":["post-158","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backend","category-frontend","tag-jquery","tag-mts-simple-booking","tag-php","tag-wordpress","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2022\/10\/meeting-g125fcd6b9_1920.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/158","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=158"}],"version-history":[{"count":2,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/158\/revisions"}],"predecessor-version":[{"id":161,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/158\/revisions\/161"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/159"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=158"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=158"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=158"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}