{"id":1808,"date":"2019-08-26T22:48:06","date_gmt":"2019-08-26T13:48:06","guid":{"rendered":"https:\/\/www.dogrow.net\/php\/?p=1808"},"modified":"2019-08-26T23:48:44","modified_gmt":"2019-08-26T14:48:44","slug":"blog63","status":"publish","type":"post","link":"https:\/\/www.dogrow.net\/php\/blog63\/","title":{"rendered":"(63) \u3010WORDPRESS\u3011\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3067\u631f\u3080\uff08\u56f2\u307f\u578b\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\uff09"},"content":{"rendered":"<h1 class=\"my_h\">1. \u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>WORDPRESS\u306e\u6295\u7a3f\u4e2d\u3067\u3001\u6307\u5b9a\u533a\u9593\u3060\u3051 <span class=\"my_fc_deeppink\">\uff1e<\/span> \u3092 <span class=\"my_fc_deeppink\">\uff1b\uff47\uff54<\/span> \u306b\u5909\u63db\u3057\u305f\u3044\u3002<\/p>\n<h1 class=\"my_h\">2. \u3084\u3063\u3066\u307f\u308b<\/h1>\n<h3 class=\"my_h\">1) \u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u7528\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u66f8\u304f\u3002<\/h3>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\/* Plugin Name: MyPre *\/\r\nif (class_exists('MyPre')) {\r\n  $gMyPre = new MyPre();\r\n}\r\nclass MyPre {\r\n  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n  public function __construct() {\r\n    \/\/ \u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\r\n    add_shortcode('myPre', array($this, 'proc'));\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  \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n  public function proc( $attr, $content=null ){\r\n    $txt = preg_replace(&quot;\/&lt;br \\\/&gt;\/i&quot;, &quot;&quot;, $content);\r\n    $txt = preg_replace(&quot;\/^\\n\/&quot;, &quot;&quot;, $txt);\r\n    $txt = esc_html($txt);\r\n    $txt = preg_replace(&quot;\/\\n\/&quot;, &quot;&lt;br \/&gt;&quot;, $txt);\r\nreturn &lt;&lt;&lt; EOM\r\n&lt;div style=&quot;border:3px #000 dotted; padding:3px;&quot;&gt;{$txt}&lt;\/div&gt;\r\nEOM;\r\n  }\r\n}\r\n<\/pre>\n<h3 class=\"my_h\">2) \u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u306e\u6295\u7a3f\u4e2d\u3067\u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u4f7f\u3046\u3002<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/php\/wp-content\/uploads\/2019\/08\/001.png\" alt=\"\" \/><\/p>\n<p>\u5b9f\u884c\u7d50\u679c\u306f\u3053\u3061\u3089\u2193\u2193\u2193<\/p>\n<div style=\"border:3px #000 dotted; padding:3px;\">\n<div class=\"myPre\">&gt;&gt;&gt;<br \/>&gt;&gt;&gt;<br \/>AAAAA<br \/>BBBBB<br \/><\/div>\n<\/div>\n<p>\u51fa\u529b\u3055\u308c\u305f\u30b3\u30fc\u30c9\u306f\u3053\u3061\u3089\u2193\u2193\u2193<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.dogrow.net\/php\/wp-content\/uploads\/2019\/08\/002.png\" alt=\"\" \/><\/p>\n<hr class=\"my_hr_bottom\">\n","protected":false},"excerpt":{"rendered":"<p>1. \u3084\u308a\u305f\u3044\u3053\u3068 WORDPRESS\u306e\u6295\u7a3f\u4e2d\u3067\u3001\u6307\u5b9a\u533a\u9593\u3060\u3051 \uff1e \u3092 \uff1b\uff47\uff54 \u306b\u5909\u63db\u3057\u305f\u3044\u3002 2. \u3084\u3063\u3066\u307f\u308b 1) \u30b7\u30e7\u30fc\u30c8\u30b3\u30fc\u30c9\u7528\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u66f8\u304f\u3002 &lt;?php \/* Plugin Name: MyPre *\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.dogrow.net\/php\/blog63\/\">\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-1808","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"views":1738,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/1808","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=1808"}],"version-history":[{"count":18,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/1808\/revisions"}],"predecessor-version":[{"id":1829,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/posts\/1808\/revisions\/1829"}],"wp:attachment":[{"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/media?parent=1808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/categories?post=1808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dogrow.net\/php\/wp-json\/wp\/v2\/tags?post=1808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}