{"id":6713,"date":"2024-10-22T12:26:05","date_gmt":"2024-10-22T03:26:05","guid":{"rendered":"https:\/\/code-plus.jp\/gp\/?p=6713"},"modified":"2026-01-08T11:16:32","modified_gmt":"2026-01-08T02:16:32","slug":"post-6713","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/post-6713\/","title":{"rendered":"WordPress\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30c7\u30a3\u30bf\u30fc\u306b\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u8ffd\u52a0\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>WordPress\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30c7\u30a3\u30bf\u30fc\u306f\u3001\u8a18\u4e8b\u3084\u30da\u30fc\u30b8\u306e\u7de8\u96c6\u3092WYSIWYG\uff08What You See Is What You Get\uff09\u5f62\u5f0f\u3067\u884c\u3048\u308b\u305f\u3081\u3001\u591a\u304f\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u611b\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u72b6\u614b\u3067\u306f\u5229\u7528\u3067\u304d\u308b\u66f8\u5f0f\u8a2d\u5b9a\u304c\u9650\u3089\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u3088\u308a\u9ad8\u5ea6\u306a\u30b9\u30bf\u30a4\u30ea\u30f3\u30b0\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306b\u306f\u6a5f\u80fd\u304c\u4e0d\u8db3\u3057\u3066\u3044\u308b\u3068\u611f\u3058\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\r\n<p>\u4eca\u56de\u306f\u3001WordPress\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30c7\u30a3\u30bf\u30fc\uff08TinyMCE\uff09\u306b\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u8ffd\u52a0\u3057\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\r\n<p>&nbsp;<\/p>\r\n<p><a class=\"wb-break-all\" href=\"https:\/\/gist.github.com\/sarap422\/1d0e7d153c732b02801c686b2906878a#file-tinymce-custom-php\"><strong class=\"user-select-contain gist-blob-name css-truncate-target\">tinymce-custom.php<\/strong><\/a><\/p>\r\n<p><a href=\"https:\/\/gist.github.com\/sarap422\/1d0e7d153c732b02801c686b2906878a\" class=\"link\">https:\/\/gist.github.com\/sarap422\/1d0e7d153c732b02801c686b2906878a<\/a><\/p>\r\n<h2>\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3068\u306f<\/h2>\r\n<p>\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3068\u306f\u3001\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30c7\u30a3\u30bf\u30fc\u306e\u30c4\u30fc\u30eb\u30d0\u30fc\u306b\u8ffd\u52a0\u3055\u308c\u308b\u66f8\u5f0f\u8a2d\u5b9a\u30e1\u30cb\u30e5\u30fc\u3067\u3059\u3002\u3053\u306e\u30e1\u30cb\u30e5\u30fc\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c6\u30ad\u30b9\u30c8\u3084\u30d6\u30ed\u30c3\u30af\u8981\u7d20\u306b\u5bfe\u3057\u3066\u3001\u3042\u3089\u304b\u3058\u3081\u5b9a\u7fa9\u3055\u308c\u305f\u30b9\u30bf\u30a4\u30eb\u3092\u7c21\u5358\u306b\u9069\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\r\n<h2>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\r\n<ol style=\"list-style-type: decimal;\">\r\n<li>\r\n<p><strong>\u4f5c\u696d\u52b9\u7387\u306e\u5411\u4e0a<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u3088\u304f\u4f7f\u7528\u3059\u308b\u30b9\u30bf\u30a4\u30eb\u3092\u30ef\u30f3\u30af\u30ea\u30c3\u30af\u3067\u9069\u7528\u53ef\u80fd<\/li>\r\n<li>HTML\u3084CSS\u306e\u77e5\u8b58\u304c\u306a\u304f\u3066\u3082\u3001\u4e00\u8cab\u6027\u306e\u3042\u308b\u30c7\u30b6\u30a4\u30f3\u3092\u5b9f\u73fe<\/li>\r\n<li>\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u306e\u624b\u9593\u3092\u524a\u6e1b<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>\r\n<p><strong>\u30c7\u30b6\u30a4\u30f3\u306e\u4e00\u8cab\u6027\u78ba\u4fdd<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u30b5\u30a4\u30c8\u5168\u4f53\u3067\u7d71\u4e00\u3055\u308c\u305f\u30b9\u30bf\u30a4\u30eb\u3092\u7dad\u6301<\/li>\r\n<li>\u8aa4\u3063\u305f\u30af\u30e9\u30b9\u306e\u9069\u7528\u3092\u9632\u6b62<\/li>\r\n<li>\u30d6\u30e9\u30f3\u30c9\u30ac\u30a4\u30c9\u30e9\u30a4\u30f3\u306b\u6cbf\u3063\u305f\u30c7\u30b6\u30a4\u30f3\u306e\u5b9f\u88c5\u304c\u5bb9\u6613<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>\r\n<p><strong>\u4fdd\u5b88\u6027\u306e\u5411\u4e0a<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u30b9\u30bf\u30a4\u30eb\u306e\u4e00\u5143\u7ba1\u7406\u304c\u53ef\u80fd<\/li>\r\n<li>CSS\u306e\u5909\u66f4\u3060\u3051\u3067\u5168\u4f53\u306e\u30c7\u30b6\u30a4\u30f3\u3092\u66f4\u65b0\u53ef\u80fd<\/li>\r\n<li>\u8907\u6570\u306e\u7de8\u96c6\u8005\u304c\u3044\u3066\u3082\u7d71\u4e00\u3055\u308c\u305f\u30b9\u30bf\u30a4\u30eb\u3092\u7dad\u6301<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<h2>\u5b9f\u88c5\u65b9\u6cd5<\/h2>\r\n<h3>1. \u57fa\u672c\u7684\u306a\u5b9f\u88c5<\/h3>\r\n<p>\u307e\u305a\u3001<code>functions.php<\/code>\u307e\u305f\u306f\u30ab\u30b9\u30bf\u30e0\u30d7\u30e9\u30b0\u30a4\u30f3\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\uff1a<\/p>\r\n<pre><code class=\"language-php\">\/\/ TinyMCE\u306b\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u8ffd\u52a0\r\nfunction add_styles_to_tinymce_buttons($buttons) {\r\n  \/\/ \u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u304c\u65e2\u306b\u5b58\u5728\u3059\u308b\u5834\u5408\u306f\u524a\u9664\r\n  $buttons = array_diff($buttons, array('styleselect'));\r\n  \r\n  \/\/ \u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u5148\u982d\u306b\u8ffd\u52a0\r\n  array_unshift($buttons, 'styleselect');\r\n  \r\n  return $buttons;\r\n}\r\nadd_filter('mce_buttons', 'add_styles_to_tinymce_buttons');\r\n<\/code><\/pre>\r\n<h3>2. \u30b9\u30bf\u30a4\u30eb\u306e\u5b9a\u7fa9<\/h3>\r\n<p>\u6b21\u306b\u3001\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306b\u8868\u793a\u3059\u308b\u30b9\u30bf\u30a4\u30eb\u3092\u5b9a\u7fa9\u3057\u307e\u3059\uff1a<\/p>\r\n<pre><code class=\"language-php\">if (!function_exists('initialize_tinymce_styles')) :\r\n  function initialize_tinymce_styles($init_array) {\r\n    $style_formats = array(\r\n      \/\/ \u30d5\u30a9\u30f3\u30c8\u30d5\u30a1\u30df\u30ea\u30fc\r\n      array(\r\n        'title' =&gt; '\u30d5\u30a9\u30f3\u30c8\u30d5\u30a1\u30df\u30ea\u30fc',\r\n        'items' =&gt; array(\r\n          array('title' =&gt; '\u30b4\u30b7\u30c3\u30af\u4f53', 'selector' =&gt; '*', 'attributes' =&gt; array('lang' =&gt; 'ja-GP')),\r\n          array('title' =&gt; '\u660e\u671d\u4f53', 'selector' =&gt; '*', 'attributes' =&gt; array('lang' =&gt; 'ja-MP')),\r\n        ),\r\n      ),\r\n      \r\n      \/\/ \u30dc\u30bf\u30f3\u30b9\u30bf\u30a4\u30eb\r\n      array(\r\n        'title' =&gt; '\u30dc\u30bf\u30f3',\r\n        'items' =&gt; array(\r\n          array('title' =&gt; '\u30d7\u30e9\u30a4\u30de\u30ea\u30fc\u30dc\u30bf\u30f3', 'inline' =&gt; 'a', 'classes' =&gt; 'button is-primary'),\r\n          array('title' =&gt; '\u30bb\u30ab\u30f3\u30c0\u30ea\u30fc\u30dc\u30bf\u30f3', 'inline' =&gt; 'a', 'classes' =&gt; 'button is-secondary'),\r\n        ),\r\n      ),\r\n      \r\n      \/\/ \u305d\u306e\u4ed6\u306e\u30b9\u30bf\u30a4\u30eb\u5b9a\u7fa9...\r\n    );\r\n    \r\n    $init_array['style_formats'] = json_encode($style_formats);\r\n    return $init_array;\r\n  }\r\nendif;\r\nadd_filter('tiny_mce_before_init', 'initialize_tinymce_styles', 10000);\r\n<\/code><\/pre>\r\n<h2>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u53ef\u80fd\u306a\u4e3b\u306a\u8981\u7d20<\/h2>\r\n<ol style=\"list-style-type: decimal;\">\r\n<li>\r\n<p><strong>\u30a4\u30f3\u30e9\u30a4\u30f3\u8981\u7d20<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u30c6\u30ad\u30b9\u30c8\u306e\u88c5\u98fe\uff08\u592a\u5b57\u3001\u659c\u4f53\u3001\u4e0b\u7dda\u306a\u3069\uff09<\/li>\r\n<li>\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba<\/li>\r\n<li>\u30c6\u30ad\u30b9\u30c8\u30ab\u30e9\u30fc<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>\r\n<p><strong>\u30d6\u30ed\u30c3\u30af\u8981\u7d20<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u898b\u51fa\u3057\uff08h1\u301ch6\uff09<\/li>\r\n<li>\u6bb5\u843d\u30b9\u30bf\u30a4\u30eb<\/li>\r\n<li>\u30de\u30fc\u30b8\u30f3\u30fb\u30d1\u30c7\u30a3\u30f3\u30b0<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>\r\n<p><strong>\u7279\u6b8a\u8981\u7d20<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u30dc\u30bf\u30f3<\/li>\r\n<li>\u30a2\u30e9\u30fc\u30c8<\/li>\r\n<li>\u5f15\u7528<\/li>\r\n<li>\u30ab\u30b9\u30bf\u30e0\u30d6\u30ed\u30c3\u30af<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<h2>\u5b9f\u88c5\u6642\u306e\u6ce8\u610f\u70b9<\/h2>\r\n<ol style=\"list-style-type: decimal;\">\r\n<li>\r\n<p><strong>\u512a\u5148\u9806\u4f4d\u306e\u8a2d\u5b9a<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u30d7\u30e9\u30a4\u30aa\u30ea\u30c6\u30a3\u5024\uff08\u4e0a\u8a18\u4f8b\u3067\u306f10000\uff09\u3092\u9069\u5207\u306b\u8a2d\u5b9a<\/li>\r\n<li>\u4ed6\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u306e\u7af6\u5408\u3092\u907f\u3051\u308b<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>\r\n<p><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3078\u306e\u914d\u616e<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u30b9\u30bf\u30a4\u30eb\u306e\u307f\u3092\u5b9a\u7fa9<\/li>\r\n<li>\u8907\u96d1\u3059\u304e\u308b\u6761\u4ef6\u5206\u5c90\u3092\u907f\u3051\u308b<\/li>\r\n<\/ul>\r\n<\/li>\r\n<li>\r\n<p><strong>\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027<\/strong><\/p>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li>\u30b3\u30e1\u30f3\u30c8\u3092\u9069\u5207\u306b\u8a18\u8ff0<\/li>\r\n<li>\u547d\u540d\u898f\u5247\u306e\u7d71\u4e00<\/li>\r\n<li>\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3092\u5fc3\u304c\u3051\u308b<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ol>\r\n<h2>\u307e\u3068\u3081<\/h2>\r\n<p>WordPress\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u4f5c\u6210\u306e\u52b9\u7387\u3092\u5927\u5e45\u306b\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u7279\u306b\u3001\u8907\u6570\u306e\u7de8\u96c6\u8005\u304c\u5b58\u5728\u3059\u308b\u74b0\u5883\u3084\u3001\u30c7\u30b6\u30a4\u30f3\u306e\u4e00\u8cab\u6027\u304c\u91cd\u8981\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u30b9\u30bf\u30a4\u30eb\u30bb\u30ec\u30af\u30c8\u30dc\u30c3\u30af\u30b9\u306e\u6d3b\u7528\u304c\u6709\u52b9\u3067\u3059\u3002<\/p>\r\n<p>\u305f\u3060\u3057\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u884c\u3046\u969b\u306f\u3001\u30e6\u30fc\u30b6\u30d3\u30ea\u30c6\u30a3\u3068\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u306e\u30d0\u30e9\u30f3\u30b9\u3092\u8003\u616e\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\u5fc5\u8981\u4ee5\u4e0a\u306b\u8907\u96d1\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306f\u907f\u3051\u3001\u5b9f\u969b\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u30cb\u30fc\u30ba\u306b\u57fa\u3065\u3044\u305f\u5b9f\u88c5\u3092\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\r\n<h2>\u53c2\u8003\u30ea\u30f3\u30af<\/h2>\r\n<ul style=\"list-style-type: bullet;\">\r\n<li><a href=\"https:\/\/codex.wordpress.org\/TinyMCE\">WordPress Codex - TinyMCE<\/a><\/li>\r\n<li><a href=\"https:\/\/www.tiny.cloud\/docs\/\">TinyMCE Documentation<\/a><\/li>\r\n<li><a href=\"https:\/\/developer.wordpress.org\/\">WordPress Developer Resources<\/a><\/li>\r\n<\/ul>","protected":false},"excerpt":{"rendered":"WordPress\u306e\u30d3\u30b8\u30e5\u30a2\u30eb\u30a8\u30c7\u30a3\u30bf\u30fc\u306f\u3001\u8a18\u4e8b\u3084\u30da\u30fc\u30b8\u306e\u7de8\u96c6\u3092WYSIWYG\uff08What You See Is What You Get\uff09\u5f62\u5f0f\u3067\u884c\u3048\u308b\u305f\u3081\u3001\u591a\u304f\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u611b\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u72b6\u614b\u3067\u306f\u5229[...]","protected":false},"author":1,"featured_media":6714,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":{"0":"post-6713","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-wordpress"},"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/6713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/comments?post=6713"}],"version-history":[{"count":1,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/6713\/revisions"}],"predecessor-version":[{"id":10386,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/6713\/revisions\/10386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media\/6714"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=6713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=6713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=6713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}