{"id":7807,"date":"2016-12-31T10:26:36","date_gmt":"2016-12-31T01:26:36","guid":{"rendered":"http:\/\/nanoappli.com\/blog\/?p=7807"},"modified":"2016-12-31T11:29:34","modified_gmt":"2016-12-31T02:29:34","slug":"wordpressshortcode%e3%81%ae%e4%b8%ad%e3%81%a7%e8%a8%98%e4%ba%8b%e3%82%bf%e3%82%a4%e3%83%88%e3%83%ab%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/nanoappli.com\/blog\/archives\/7807","title":{"rendered":"[WordPress]shortcode\u3067\u8a18\u4e8b\u30bf\u30a4\u30c8\u30eb\u3084\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30c9\u306e\u5185\u5bb9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\n<h2>shortcode\u3067\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3059\u308b<\/h2>\nWordPress\u3067\u306f\u3001\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001php\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51fa\u529b\u7d50\u679c\u3092\u8a18\u4e8b\u4e2d\u306b\u57cb\u3081\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u63d0\u4f9b\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3001get_the_title()\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n<br \/>\nfunction.php<br \/>\n<pre lang=\"php\">\nfunction func_showTitle() {\n    return \"\u3053\u306e\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u306f[\" . get_the_title() . \"]\u3067\u3059\";\n}\n\nadd_shortcode('showtitle', 'func_showTitle');\n<\/pre>\n<br \/>\n\u8a18\u4e8b\u4e2d\u3067<strong>[showtitle]<\/strong>\u3068\u8a18\u8f09\u3059\u308b\u3053\u3068\u3067\u3001\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002<br \/>\n<br \/>\n<h2>shortcode\u3067\u8a18\u4e8bID\u3084\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30c9\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b<\/h2>\nshortcode\u306e\u51e6\u7406\u5185\u3067\u3001\u8a18\u4e8b\u306eID\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u3001get_the_ID()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u53d6\u5f97\u53ef\u80fd\u3067\u3059\u3002\u307e\u305f\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30c9\u306e\u60c5\u5831(wp_postmeta\u30c6\u30fc\u30d6\u30eb\u306e\u5185\u5bb9)\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u3001get_the_ID()\u3067\u53d6\u5f97\u3057\u305fpost_id\u3092\u5f15\u6570\u306bget_post_meta()\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u305b\u3070\u53d6\u5f97\u53ef\u80fd\u3067\u3059\u3002<br \/>\n<br \/>\n\u4e0b\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30c9\u3068\u3057\u3066\u8a2d\u5b9a\u3055\u308c\u305f\u5546\u54c1\u540d(item_name)\u3092\u8868\u793a\u3059\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002<br \/>\n<pre lang=\"php\">\nfunction func_showItem() {\n    $postMeta= get_post_meta( get_the_ID() );\n    $name = $postMeta[\"item_name\"];\n    return \"\u5546\u54c1\u540d: {$name}\";\n}\nadd_shortcode('showItem', 'func_showItem');\n<\/pre>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>shortcode\u3067\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3059\u308b WordPress\u3067\u306f\u3001\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001php\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51fa\u529b\u7d50\u679c\u3092\u8a18\u4e8b\u4e2d\u306b\u57cb\u3081\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u63d0\u4f9b\u3059\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3001get_the_title()\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 function.php function func_showTitle() { return &#8220;\u3053\u306e\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u306f[&#8221; . get_the_title() . &#8220;]\u3067\u3059&#8221;; } add_shortcode(&#8216;showtitle&#8217;, &#8216;func_showTitle&#8217;); \u8a18\u4e8b\u4e2d\u3067[showtitle]\u3068\u8a18\u8f09\u3059\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[13],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":4889,"url":"http:\/\/nanoappli.com\/blog\/archives\/4889","url_meta":{"origin":7807,"position":0},"title":"[WordPress]title\u30bf\u30b0\u306e\u8868\u793a\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b","date":"2012\u5e7410\u67087\u65e5","format":false,"excerpt":"WordPress\u306e\u30c6\u30fc\u30de\u7de8\u96c6\u3067\u3001\u4ee5\u4e0b\u306e\u69d8\u306a\u30bf\u30a4\u30c8\u30eb\u8868\u793a\u3092\u884c\u308f\u305b\u3066\u307f\u307e\u3059\u3002 \u30da\u30fc\u30b8\u30bf\u30a4\u30c8\u30eb\u3092\u8868\u793a\u3059\u308b\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4817,"url":"http:\/\/nanoappli.com\/blog\/archives\/4817","url_meta":{"origin":7807,"position":1},"title":"[WordPress]\u30ab\u30c6\u30b4\u30ea\u5225\/\u30bf\u30b0\u5225\u306eRSS\u30ea\u30f3\u30af\u3092\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u308f\u305a\u306b\u8ffd\u52a0\u3059\u308b","date":"2012\u5e749\u670830\u65e5","format":false,"excerpt":"WordPress\u3067\u30ab\u30c6\u30b4\u30ea\u5225\u3084\u30bf\u30b0\u5225\u306e\u30ea\u30f3\u30af\u96c6\u3092\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u305b\u305a\u306b\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002 \u51fa\u6765\u3042\u304c\u308a\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/09\/20120930_03.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":7874,"url":"http:\/\/nanoappli.com\/blog\/archives\/7874","url_meta":{"origin":7807,"position":2},"title":"[WordPress]Lightning\u30c6\u30fc\u30de\u3067\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u306b\u8a18\u4e8b\u540d\u3092\u51fa\u3055\u306a\u3044","date":"2017\u5e741\u67084\u65e5","format":false,"excerpt":"WordPress\u306eBootstrap\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30de\u3067\u3042\u308b\u3001Lightning\u3067\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u306e\u30ab\u30b9\u2026","rel":"","context":"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":939,"url":"http:\/\/nanoappli.com\/blog\/archives\/939","url_meta":{"origin":7807,"position":3},"title":"[WordPress]\u4eca\u6708\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3057\u3066\u8868\u793a\u3055\u305b\u308b","date":"2012\u5e741\u670830\u65e5","format":false,"excerpt":"WordPress\u3067\u3001\u5f53\u6708\u306e\u6295\u7a3f\u6570\u3092\u53d6\u5f97\u3057\u3066\u753b\u9762\u306b\u8868\u793a\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u3002 \u3061\u3087\u3063\u3068\u30c6\u30b9\u30c8\u3057\u3066\u307f\u305f\u3068\u3053\u308d\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/20120130_04.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2542,"url":"http:\/\/nanoappli.com\/blog\/archives\/2542","url_meta":{"origin":7807,"position":4},"title":"[C#]\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30ab\u30a6\u30f3\u30bf\u304b\u3089\u53d6\u5f97\u3057\u305f\u5024\u306e\u5c65\u6b74\u3092,\u4e00\u5b9a\u4ef6\u6570\u899a\u3048\u3066\u304a\u304f","date":"2012\u5e745\u670818\u65e5","format":false,"excerpt":"Windows\u306b\u6a19\u6e96\u3067\u642d\u8f09\u3055\u308c\u3066\u3044\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u30e2\u30cb\u30bf\u3067\u306f\u3001PC\u306e\u73fe\u5728\u306e\u72b6\u614b\u3092\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/05\/20120518_03-500x333.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":4409,"url":"http:\/\/nanoappli.com\/blog\/archives\/4409","url_meta":{"origin":7807,"position":5},"title":"C#\u3067Amazon\u306eMWS\u3092\u4f7f\u7528\u3057\u3066,\u30de\u30b1\u30d7\u30ec\u306e\u51fa\u54c1\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b","date":"2012\u5e749\u670810\u65e5","format":false,"excerpt":"Amazon\u3067\u306f\u3001Marketplace WebService API(Amazon MWS)\u3092\u4f7f\u7528\u2026","rel":"","context":"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/nanoappli.com\/blog\/wp-content\/uploads\/2012\/09\/20120910_06.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/7807"}],"collection":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/comments?post=7807"}],"version-history":[{"count":7,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/7807\/revisions"}],"predecessor-version":[{"id":7836,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/posts\/7807\/revisions\/7836"}],"wp:attachment":[{"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/media?parent=7807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/categories?post=7807"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nanoappli.com\/blog\/wp-json\/wp\/v2\/tags?post=7807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}