{"id":1858,"date":"2019-12-02T06:10:21","date_gmt":"2019-12-01T21:10:21","guid":{"rendered":"https:\/\/www.dogrow.net\/php\/?p=1858"},"modified":"2019-12-02T14:52:18","modified_gmt":"2019-12-02T05:52:18","slug":"blog65","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/php\/blog65\/","title":{"rendered":"(65) \u3010WORDPRESS\u3011\u30c6\u30fc\u30d6\u30eb\u3092\u7c21\u5358\u306b\u4f5c\u308c\u308b\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u81ea\u4f5c\u3059\u308b\u3002"},"content":{"rendered":"<h1 class=\"my_h\">1. \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>WORDPRESS\u306e\u8a18\u4e8b\u3092\u57f7\u7b46\u4e2d\u306b\u3001\u672c\u6587\u4e2d\u306b <span class=\"my_fc_deeppinkBBig\">table<\/span> \u3092\u66f8\u304d\u305f\u3044\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<p>table, tr, th, td\u306a\u3069\u306e\u30bf\u30b0\u3092\u4f7f\u3063\u3066\u66f8\u304f\u306e\u306f\u7169\u308f\u3057\u3044\u306e\u3067\u3001Redmine\u306e\u3088\u3046\u306b <span class=\"my_fc_deeppinkBBig\">|<\/span> \u3092\u30bb\u30d1\u30ec\u30fc\u30bf\u30fc\u3068\u3057\u3066\u7c21\u5358\u306b\u66f8\u304d\u305f\u3044\u3002<\/p>\n<p>\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e <span class=\"my_fc_deeppinkBBig\">\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f5c\u308a\u305f\u3044\u3002<\/span><\/p>\n<h1 class=\"my_h\">2. \u3084\u3063\u3066\u307f\u308b<\/h1>\n<h2 class=\"my_h\">1) \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u4ed5\u69d8<\/h2>\n<p>\u4ed5\u69d8\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<br \/>\n\u30fb\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9 SimpleTable \u3067\u631f\u307e\u308c\u305f\u533a\u9593\u3092\u5bfe\u8c61\u3068\u3059\u308b\u3002<br \/>\n\u30fb\u672c\u6587\u4e2d\u306e 1\u884c\u304c\u3001\u30c6\u30fc\u30d6\u30eb\u4e0a\u306e 1\u884c\u3068\u306a\u308b\u3002<br \/>\n\u30fb1\u884c\u306e\u4e2d\u306e\u5217\u306f\u3001<span class=\"my_fc_deeppinkBBig\">|<\/span> \u3092\u30bb\u30d1\u30ec\u30fc\u30bf\u30fc\u3068\u3057\u3066\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n<h2 class=\"my_h\">2) \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h2>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ \u5f53\u8a72\u30d7\u30e9\u30b0\u30a4\u30f3\u30af\u30e9\u30b9\u306b\u5b9f\u4f53\u3092\u6301\u305f\u305b\u308b\u3002\u2192 __construct()\u304b\u3089\u51e6\u7406\u8d77\u52d5\r\nif (class_exists('SimpleTable')) {\r\n  $gSimpleTable = new SimpleTable();\r\n}\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\nclass SimpleTable {\r\n  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n  public function __construct() {\r\n    \/\/------------------------------------------------------------------\r\n    \/\/ \u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u767b\u9332\r\n    add_shortcode('SimpleTable', array($this, 'proc_shortcode'));\r\n    \/\/ \u30c6\u30ad\u30b9\u30c8\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u306e\u4e2d\u3067\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u53ef\u80fd\u306b\u8a2d\u5b9a\r\n    add_filter('widget_text', 'do_shortcode');\r\n    \/\/------------------------------------------------------------------\r\n    \/\/ \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u6709\u52b9\u5316\u3001\u7121\u52b9\u5316\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30b3\u30fc\u30eb\u3055\u305b\u308b\u3002\r\n    register_activation_hook(  __FILE__, array($this, 'proc_plugin_activate'));\r\n    register_deactivation_hook(__FILE__, array($this, 'proc_plugin_deactivate'));\r\n  }\r\n  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n  public function proc_plugin_activate(){\r\n    \/\/ \u7279\u306b\u51e6\u7406\u306a\u3057\u3002\r\n  }\r\n  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n  public function proc_plugin_deactivate(){\r\n    \/\/ \u7279\u306b\u51e6\u7406\u306a\u3057\u3002\r\n  }\r\n  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n  public function proc_shortcode( $attr, $content=null ){\r\n    \/\/ table\u306e\u30af\u30e9\u30b9\u6307\u5b9a\u304c\u3042\u308c\u3070\u53d6\u5f97\u3059\u308b\u3002\r\n    $table_class = isset($attr&#x5B;'class_'])? $attr&#x5B;'class_'] : '';\r\n\r\n    \/\/ 1\u884c\u305a\u3064 content\u306e\u5185\u5bb9\u3092\u89e3\u6790\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u306b\u7f6e\u304d\u63db\u3048\u308b\u3002\r\n    $trs = '';\r\n    $ary_line = explode(&quot;&lt;br \/&gt;&quot;, $content);\r\n    foreach($ary_line as $line){\r\n      $line = trim($line);\r\n      if($line == ''){\r\n        continue;\r\n      }\r\n      $ary_td = explode('|', $line);\r\n      $tds = '';\r\n      foreach($ary_td as $td){\r\n        $td = trim($td);\r\n        if($td == ''){\r\n          continue;\r\n        }\r\n        $tds .= '&lt;td&gt;'.$td.'&lt;\/td&gt;';\r\n      }\r\n      $trs .= '&lt;tr&gt;'.$tds.'&lt;\/tr&gt;';\r\n    }\r\nreturn &lt;&lt;&lt; EOM\r\n&lt;table class=&quot;{$table_class}&quot;&gt;\r\n{$trs}\r\n&lt;\/table&gt;\r\nEOM;\r\n  }\r\n}     \/\/ end of class\r\n<\/pre>\n<h2 class=\"my_h\">3) \u4f7f\u7528\u4f8b<\/h2>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3001<br \/>\n\u30c6\u30fc\u30d6\u30eb\u5168\u4f53\u3092\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3067\u56f2\u307f\u3001<br \/>\n<span class=\"my_fc_deeppinkBBig\">|<\/span> \u3092\u30bb\u30d1\u30ec\u30fc\u30bf\u3068\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u66f8\u304f\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/php\/wp-content\/uploads\/2019\/12\/001.png\" alt=\"\" \/><\/p>\n<p>\u3059\u308b\u3068&#8230;<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5c55\u958b\u3055\u308c\u308b\u3002<\/p>\n<table class=\"\">\n<tr><td>1<\/td><td>AAA<\/td><\/tr><tr><td>2<\/td><td>BBB<\/td><\/tr><tr><td>3<\/td><td>CCC<\/td><\/tr>\n<\/table>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u30b9\u30bf\u30a4\u30eb\u306f\u3001\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3067\u30af\u30e9\u30b9\u540d<br \/>\n<span class=\"my_fc_deeppinkBBig\">class_=&#8221;xxxxx&#8221;<\/span><br \/>\n\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u81ea\u7531\u306b\u88c5\u98fe\u3067\u304d\u308b\u3002<\/p>\n<h1 class=\"my_h\">3. \u6240\u611f<\/h1>\n<p>\u30fbproc_shortcode()\u306e\u4e2d\u306e\u51e6\u7406\u304c\u624b\u629c\u304d\u904e\u304e\u3060\u306a&#8230;<br \/>\n\u3000\u2192 \u5f8c\u3067\u6642\u9593\u3092\u4f5c\u3063\u3066\u3001\u3082\u3046\u3061\u3087\u3063\u3068\u4e01\u5be7\u306b\u4f5c\u308d\u3046\u3068\u601d\u3046\u3002<\/p>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>1. \u3084\u308a\u305f\u3044\u3053\u3068 WORDPRESS\u306e\u8a18\u4e8b\u3092\u57f7\u7b46\u4e2d\u306b\u3001\u672c\u6587\u4e2d\u306b table \u3092\u66f8\u304d\u305f\u3044\u3053\u3068\u304c\u3042\u308b\u3002 table, tr, th, td\u306a\u3069\u306e\u30bf\u30b0\u3092\u4f7f\u3063\u3066\u66f8\u304f\u306e\u306f\u7169\u308f\u3057\u3044\u306e\u3067\u3001Redmine\u306e\u3088\u3046\u306b | \u3092\u30bb\u30d1\u30ec\u30fc\u30bf\u30fc\u3068\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/php\/blog65\/\">\u7d9a\u304d\u3092\u8aad\u3080 &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1858","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"views":1394,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/1858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/comments?post=1858"}],"version-history":[{"count":23,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/1858\/revisions"}],"predecessor-version":[{"id":1883,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/1858\/revisions\/1883"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/media?parent=1858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/categories?post=1858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/tags?post=1858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}