{"id":5552,"date":"2023-09-29T13:23:43","date_gmt":"2023-09-29T04:23:43","guid":{"rendered":"https:\/\/wpmake.jp\/contents\/?post_type=customize&#038;p=5552"},"modified":"2023-10-23T18:03:43","modified_gmt":"2023-10-23T09:03:43","slug":"split-source-code-of-functions","status":"publish","type":"customize","link":"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/","title":{"rendered":"WordPress\u30c6\u30fc\u30de\u306efunctions.php\u3092\u898b\u3084\u3059\u304f\u3059\u308b"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u6b21<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #282828;color:#282828\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #282828;color:#282828\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\" >\u306f\u3058\u3081\u306b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6\" >\u524d\u63d0\u6761\u4ef6<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3\" >\u4f7f\u7528\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3\" >\u4f7f\u7528\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E4%BD%9C%E6%A5%AD%E7%94%A8%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%AE%E6%A7%8B%E6%88%90%E5%9B%B3\" >\u4f5c\u696d\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u69cb\u6210\u56f3<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E6%95%B4%E7%90%86%E3%81%99%E3%82%8B%E5%89%8D%E3%81%AE%E3%82%BD%E3%83%BC%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89\" >\u6574\u7406\u3059\u308b\u524d\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E5%88%86%E5%89%B2%E6%89%8B%E9%A0%86\" >\u5206\u5272\u624b\u9806<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#1_%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%94%E3%81%A8%E3%81%AB%E9%96%A2%E6%95%B0%E3%82%92%E3%81%B2%E3%81%A8%E3%81%A4%E3%81%AB%E3%81%99%E3%82%8B\" >1. \u30d5\u30a1\u30a4\u30eb\u3054\u3068\u306b\u95a2\u6570\u3092\u3072\u3068\u3064\u306b\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#2_%E9%96%A2%E6%95%B0%E3%82%92%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%B8\" >2. \u95a2\u6570\u3092\u30af\u30e9\u30b9\u3078<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#3_namespace_%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B\" >3. namespace \u3092\u8a2d\u5b9a\u3059\u308b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#4_PHP_%E3%82%B3%E3%83%BC%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E8%A6%8F%E7%B4%84%E3%81%AB%E5%89%87%E3%81%A3%E3%81%A6%E6%95%B4%E5%BD%A2\" >4. PHP \u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u5247\u3063\u3066\u6574\u5f62<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#5_require_%E3%81%AB%E3%82%88%E3%82%8B%E8%AA%AD%E8%BE%BC%E5%9B%9E%E6%95%B0%E3%82%92%E6%B8%9B%E3%82%89%E3%81%99\" >5. require \u306b\u3088\u308b\u8aad\u8fbc\u56de\u6570\u3092\u6e1b\u3089\u3059<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E5%88%86%E5%89%B2%E5%BE%8C%E3%81%AE_functionsphp\" >\u5206\u5272\u5f8c\u306e functions.php<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E3%81%BE%E3%81%A8%E3%82%81\" >\u307e\u3068\u3081<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/wpmake.jp\/contents\/customize\/split-source-code-of-functions\/#%E5%8F%82%E8%80%83%E8%A8%98%E4%BA%8B_URL\" >\u53c2\u8003\u8a18\u4e8b URL<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\"><\/span>\u306f\u3058\u3081\u306b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u69d8\u3005\u306a\u7406\u7531\u3067\uff11\u3064\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u95a2\u6570\u3092\u591a\u6570\u8a18\u8ff0\u3057\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002\u79c1\u3082\u305d\u306e\u4e00\u4eba\u3067\u3042\u308a\u3001 functions.php \u306b\u95a2\u6570\u3092\u307e\u3068\u3081\u3066\u3044\u307e\u3057\u305f\u3002\u672c\u8a18\u4e8b\u306f\u3001\u305d\u306e\u3088\u3046\u306a\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u8fd4\u3057\u305f\u3068\u304d\u306b\u7406\u89e3\u3057\u3084\u3059\u304f\u3059\u308b\u65b9\u6cd5\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%89%8D%E6%8F%90%E6%9D%A1%E4%BB%B6\"><\/span>\u524d\u63d0\u6761\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6700\u521d\u306b\u3001\u624b\u76f4\u3057\u3059\u308b\u524d\u306e functions.php \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3001\u305d\u306e\u3042\u3068\u300c\u5206\u5272\u624b\u9806\u300d\u306b\u3066\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8907\u6570\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5206\u5272\u3057\u3001\u30b3\u30fc\u30c9\u306e\u8a18\u8ff0\u91cf\u3092\u6e1b\u3089\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u5206\u5272\u5f8c\u306e functions.php \u3092\u78ba\u8a8d\u3057\u3001\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u306e\u53c2\u8003\u306b\u3057\u3066\u3082\u3089\u3048\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u524d\u63d0\u3068\u3057\u3066\u3001\u79c1\u306f\u4ee5\u4e0b\u306e\u6761\u4ef6\u3067\u4f5c\u696d\u3092\u3057\u307e\u3057\u305f\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3\"><\/span>\u4f7f\u7528\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u7de8\u96c6\u306bVSCode\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u69cb\u7bc9\u306bDocker\u3001\u30b3\u30de\u30f3\u30c9\u5165\u529b\u306b\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>VSCode (PHP Intelephense \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6e08\u307f)<\/li>\n<li>Docker Desktop (Windows \u7248)<\/li>\n<li>\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8 (Bash \u4f7f\u7528)<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%9F%E3%82%B3%E3%83%B3%E3%83%86%E3%83%8A%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3\"><\/span>\u4f7f\u7528\u3057\u305f\u30b3\u30f3\u30c6\u30ca\u30a4\u30e1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Docker\u30b3\u30f3\u30c6\u30ca\u306e\u30a4\u30e1\u30fc\u30b8\u306b\u3064\u3044\u3066\u3001\u305d\u308c\u305e\u308c\u4ee5\u4e0b\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u69cb\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>WordPress: 6.2<\/li>\n<li>PHP: 8.2<\/li>\n<li>Mysql: 5.7<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BD%9C%E6%A5%AD%E7%94%A8%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%AE%E6%A7%8B%E6%88%90%E5%9B%B3\"><\/span>\u4f5c\u696d\u7528\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u69cb\u6210\u56f3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre>txt\r\n\/path\/to\/geek (Bind mount: \/var\/www\/html\/wp-content\/themes\/geek)\r\n        \u251c\u2500\u2500 functions.php\r\n        \u251c\u2500\u2500 index.php\r\n        \u2514\u2500\u2500 style.css\r\n<\/pre>\n<p>\u672c\u76ee\u7684\u306ffunctions.php\u306e\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u306e\u305f\u3081\u3001\u672c\u8a18\u4e8b\u3067\u306f\u3001\u958b\u767a\u3057\u305f\u30b5\u30a4\u30c8\u306e\u6a5f\u80fd\u7b49\u306f\u307b\u307c\u5b8c\u6210\u306e\u72b6\u614b\u304b\u3089\u9032\u3081\u308b\u3053\u3068\u3092\u60f3\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%95%B4%E7%90%86%E3%81%99%E3%82%8B%E5%89%8D%E3%81%AE%E3%82%BD%E3%83%BC%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89\"><\/span>\u6574\u7406\u3059\u308b\u524d\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u30c6\u30fc\u30de\u4f5c\u6210\u3092\u9032\u3081\u3066\u3044\u304f\u4e2d\u3067\u3001\u79c1\u306f functions.php \u306b\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>style.css \u3092 WordPress \u306b\u53d6\u5f97\u3055\u305b\u308b\u305f\u3081\u306e\u95a2\u6570<sup>[<a href=\"#reference\">^1<\/a>]<\/sup><\/li>\n<li>\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306e\u914d\u5217\u3068\u95a2\u6570<sup>[<a href=\"#reference\">^2<\/a>]<\/sup><\/li>\n<li>\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306e\u914d\u5217\u3068\u95a2\u6570<sup>[<a href=\"#reference\">^3<\/a>]<\/sup><\/li>\n<li>\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306e\u95a2\u6570<sup>[<a href=\"#reference\">^4<\/a>]<\/sup><\/li>\n<\/ul>\n<p>\u6b21\u306b functions.php \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u95a2\u6570\u51e6\u7406\u306e\u8aac\u660e\u306f\u5272\u611b\u3057\u307e\u3059\u3002<\/p>\n<details style=\"padding: 30px; background: #F3F5F6; margin: 50px 0;\">\n<summary>\u6574\u7406\u524d\u306efunctions.php\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\uff08\u30af\u30ea\u30c3\u30af\u3067\u958b\u304d\u307e\u3059\uff09<\/summary>\n<pre>\r\n<?php\r\n\/\/ Theme\u306e\u30b9\u30bf\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\r\nfunction enqueueScripts()\r\n{\r\n  wp_enqueue_style('stylesheet', get_stylesheet_uri());\r\n}\r\n\/\/\u5b9f\u884c\u51e6\u7406\r\nadd_action(\r\n  'wp_enqueue_scripts',\r\n  enqueueScripts(...)\r\n);\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u306e\u4f5c\u6210\r\nfunction createPostType()\r\n{\r\n  $POST_TYPES = [\r\n    'news' => 'NEWS',\r\n    'media' => 'Media',\r\n    'work' => 'WORK',\r\n    'office' => 'Office',\r\n  ];\r\n  foreach ($POST_TYPES as $key => $post_type) {\r\n    register_post_type(\r\n      $key,\r\n      getPostTypeDefinition($post_type)\r\n    );\r\n    register_taxonomy(\r\n      ($key . '_cat'),\r\n      $key,\r\n      getTaxonomyDefinitionWhetherTagOrCat(\r\n        '\u30ab\u30c6\u30b4\u30ea\u30fc[' . $post_type . ']',\r\n        true\r\n      )\r\n    );\r\n    register_taxonomy(\r\n      ($key . '_tag'),\r\n      $key,\r\n      getTaxonomyDefinitionWhetherTagOrCat(\r\n        '\u30bf\u30b0[' . $post_type . ']',\r\n        false\r\n      )\r\n    );\r\n  }\r\n}\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u306e\u5b9a\u7fa9\r\nfunction getPostTypeDefinition($label)\r\n{\r\n  return (array(\r\n    'label' => $label,\r\n    'public' => true,\r\n    'has_archive' => true,\r\n    'menu_position' => 5,\r\n    'show_in_rest' => true,\r\n    'supports' => [\r\n      'title',\r\n      'editor',\r\n      'thumbnail',\r\n      'revisions',\r\n      'excerpt',\r\n    ]\r\n  ));\r\n}\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u306e\u30bf\u30af\u30bd\u30ce\u30df\u30fc\u5b9a\u7fa9\r\nfunction getTaxonomyDefinitionWhetherTagOrCat($label, $is_hierarchical)\r\n{\r\n  return (array(\r\n    'label' => $label,\r\n    'hierarchical' => $is_hierarchical,\r\n    'public' => true,\r\n    'show_in_rest' => true,\r\n    'update_count_callback' =>\r\n      $is_hierarchical == true ? '' : '_update_post_term_count',\r\n  ));\r\n}\r\n\/\/\u5b9f\u884c\u51e6\u7406\r\nadd_action(\r\n  'init',\r\n  createPostType(...)\r\n);\r\n\r\n\/\/\u6295\u7a3f\u4f5c\u6210\u753b\u9762\u3067\u3001\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30d5\u30a9\u30fc\u30e0\u6b04\u3092\u51fa\u529b\u3059\u308b\r\nfunction formCustomFields($post, $box)\r\n{\r\n  wp_nonce_field('meta_box_action', 'my_meta_box_nonce'); ?>\r\n    <div id=\"meta_info\">\r\n      <p>\u30da\u30fc\u30b8\u306e\u30e1\u30bf\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\r\n  <?php\r\n      foreach ($box['args'] as $key => $label) :\r\n        $cf_title_key = trim($key);\r\n        $cf_title_label = trim($label);\r\n        $cf_title_value = esc_html(get_post_meta(\r\n                                    $post->ID,\r\n                                    $cf_title_key,\r\n                                    true\r\n                          ));\r\n      ?>\r\n        <div>\r\n          <label for=\"<?php echo $cf_title_key ?>\"> <?php echo $cf_title_label; ?> <\/label><br>\r\n          <input type=\"text\" name=\"<?php echo  $cf_title_key  ?>\" value=\"<?php echo $cf_title_value ?>\" size=70>\r\n        <\/div>\r\n      <?php endforeach; ?>\r\n    <\/div>\r\n  <?php\r\n}\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5b9a\u7fa9\r\nfunction createCustomFields()\r\n{\r\n  $CUSTOM_FIELDS = [\r\n    'addressNumber' => '\u4f4f\u6240\u756a\u53f7',\r\n    'address' => '\u4f4f\u6240\u6b04',\r\n    'tel' => '\u96fb\u8a71\u756a\u53f7',\r\n    'fax' => '\u30d5\u30a1\u30c3\u30af\u30b9\u756a\u53f7',\r\n    'email' => '\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9',\r\n  ];\r\n  add_meta_box(\r\n    'custom_field_office',\r\n    '\u5185\u90e8\u60c5\u5831\u5165\u529b\u6b04',\r\n    formCustomFields(...),\r\n    'office',\r\n    'normal',\r\n    'high',\r\n    $CUSTOM_FIELDS,\r\n  );\r\n}\r\n\/\/\u5b9f\u884c\u51e6\u7406\r\nadd_action(\r\n  'admin_menu',\r\n  createCustomFields(...)\r\n);\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u4fdd\u5b58\r\nfunction saveCustomFields($post_id)\r\n{\r\n  foreach ($_POST as $key => $value) {\r\n    if (!empty($_POST[$key])) {\r\n      update_post_meta($post_id, $key, $value);\r\n    } else {\r\n      delete_post_meta($post_id, $key);\r\n      }\r\n  };\r\n}\r\n\/\/\u5b9f\u884c\u51e6\u7406\r\nadd_action(\r\n  'save_post',\r\n  saveCustomFields(...)\r\n);\r\n<\/pre>\n<\/details>\n<p>\u6574\u7406\u524d\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u5927\u304d\u306a\u554f\u984c\u70b9\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5168\u4f53\u304c\u9577\u6587\u5316\u3057\u3066\u3044\u308b\u3053\u3068<\/li>\n<li>\u6a5f\u80fd\u3054\u3068\u306b\u5206\u3051\u3089\u308c\u3066\u8a18\u8ff0\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u95a2\u6570\u306e\u5b9a\u7fa9\u3068\u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30c3\u30af\u306e\u5b9f\u884c\u304c\u7e70\u308a\u8fd4\u3057\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u3053\u3068<\/li>\n<\/ul>\n<p>\u3053\u308c\u3089\u306e\u554f\u984c\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u3053\u3068\u3067\u89e3\u6d88\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u6a5f\u80fd\u3054\u3068\u306b\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u5316\u3092\u884c\u3046<\/li>\n<li>\u5b9a\u7fa9\u7b87\u6240\u3068\u5b9f\u884c\u7b87\u6240\u3092\u6574\u7406\u3059\u308b<\/li>\n<li>functions.php\u5185\u3067\u306f\u5024\u3092\u6271\u308f\u306a\u3044<\/li>\n<li>PHP\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u5247\u3063\u305f\u8a18\u8ff0\u3092\u884c\u3046<\/li>\n<li>\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b<\/li>\n<\/ol>\n<p>\u5b9f\u969b\u306b\u3001\u5206\u5272\u306e\u624b\u9806\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%88%86%E5%89%B2%E6%89%8B%E9%A0%86\"><\/span>\u5206\u5272\u624b\u9806<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1_%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%94%E3%81%A8%E3%81%AB%E9%96%A2%E6%95%B0%E3%82%92%E3%81%B2%E3%81%A8%E3%81%A4%E3%81%AB%E3%81%99%E3%82%8B\"><\/span>1. \u30d5\u30a1\u30a4\u30eb\u3054\u3068\u306b\u95a2\u6570\u3092\u3072\u3068\u3064\u306b\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u4e0a\u8a18\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u306f\u30017\u3064\u306e\u95a2\u6570\uff08function\uff09\u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u306e\u95a2\u6570\u3054\u3068\u306b\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u5316\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u65b0\u898f\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u306f\u95a2\u6570\u540d\u3068\u540c\u4e00\u306b\u3057\u307e\u3059\u3002<\/li>\n<li>\u305d\u3057\u3066\u3001\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u65b0\u898f\u4f5c\u6210\u3057\u305finc\u30d5\u30a9\u30eb\u30c0\u306b\u307e\u3068\u3081\u307e\u3059\u3002<\/li>\n<li>functions.php\u3067\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u308a\u8fbc\u3081\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<p>\u3053\u306e\u5de5\u7a0b\u3067\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u5168\u4f53\u306e\u8a18\u8ff0\u91cf\u306f\u5927\u304d\u304f\u5909\u308f\u308a\u307e\u305b\u3093\u304c\u3001 functions.php\u306e\u8a18\u8ff0\u91cf\u3092\u5927\u5e45\u306b\u6e1b\u3089\u3057\u3001\u898b\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u3068\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u629c\u7c8b\u3067\u3059\u3002<\/p>\n<p><strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/strong><\/p>\n<pre>txt\r\n\/path\/to\/geek\r\n        \u251c\u2500\u2500 inc\r\n        \u2502     \u251c\u2500\u2500 enqueueScripts.php\r\n        \u2502     \u251c\u2500\u2500 createPostType.php\r\n        \u2502     \u251c\u2500\u2500 getPostTypeDefinition.php\r\n        \u2502     \u251c\u2500\u2500 getTaxonomyDefinitionWhetherTagOrCat.php\r\n        \u2502     \u251c\u2500\u2500 createCustomFields.php\r\n        \u2502     \u251c\u2500\u2500 formCustomFields.php\r\n        \u2502     \u2514\u2500\u2500 saveCustomFields.php\r\n        \u251c\u2500\u2500 functions.php\r\n        \u251c\u2500\u2500 index.php\r\n        \u2514\u2500\u2500 style.css\r\n<\/pre>\n<p><strong>functions.php \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/strong><br \/>\nfunctions.php \u3067\u306f WordPress\u30d5\u30c3\u30af\u95a2\u6570\u3092\u5b9f\u884c\u3057\u305f\u3044\u305f\u3081\u3001\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307e\u305b\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\r\n<?php\r\nrequire_once __DIR__ . \"\/inc\/enqueueScripts.php\"\r\nrequire_once __DIR__ . \"\/inc\/createPostType.php\"\r\n\/\/\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u306f createPostType.php \u3088\u308a\u53d6\u5f97\u3002\r\n\/*\r\n  require_once __DIR__ . \"\/inc\/getPostTypeDefinition.php\"\r\n  require_once __DIR__ . \"\/inc\/getTaxonomyDefinitionWhetherTagOrCat.php\"\r\n*\/\r\nrequire_once __DIR__ . \"\/inc\/createCustomFields.php\"\r\n\/\/\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u306f createCustomFields.php \u3088\u308a\u53d6\u5f97\u3002\r\n\/*\r\n  require_once __DIR__ . \"\/inc\/formCustomFields.php\"\r\n*\/\r\nrequire_once __DIR__ . \"\/inc\/saveCustomFields.php\"\r\n\r\nadd_action('wp_enqueue_scripts',enqueueScripts(...));\r\nadd_action('init',createPostType(...));\r\nadd_action('admin_menu',createCustomFields(...));\r\nadd_action('save_post',saveCustomFields(...));\r\n<\/pre>\n<p><strong>inc\/createPostType.php \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/strong><br \/>\ncreatePostType.php \u3067\u306f\u3001\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u5b9a\u7fa9\u306b\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092 createPostType.php \u304b\u3089\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>\r\n<?php\r\n\r\nrequire_once __DIR__ . \"\/getPostTypeDefinition.php\"\r\nrequire_once __DIR__ . \"\/getTaxonomyDefinitionWhetherTagOrCat.php\"\r\n\r\n$POST_TYPES = [\r\n    'news' => 'NEWS',\r\n    'media' => 'Media',\r\n    'work' => 'WORK',\r\n    'office' => 'Office',\r\n];\r\n\r\nfunction createPostType()\r\n{\r\n  foreach ($POST_TYPES as $key => $post_type) {\r\n      register_post_type(\r\n          $key,\r\n          getPostTypeDefinition($post_type) \/\/array\u3092\u8fd4\u3059\u3002\r\n      );\r\n      register_taxonomy(\r\n          ($key . '_cat'),\r\n          $key,\r\n          getTaxonomyDefinitionWhetherTagOrCat(\r\n              '\u30ab\u30c6\u30b4\u30ea\u30fc[' . $post_type . ']',\r\n              true\r\n          )\/\/array\u3092\u8fd4\u3059\u3002\r\n      );\r\n      register_taxonomy(\r\n          ($key . '_tag'),\r\n          $key,\r\n          getTaxonomyDefinitionWhetherTagOrCat(\r\n              '\u30bf\u30b0[' . $post_type . ']',\r\n              false\r\n          )\/\/array\u3092\u8fd4\u3059\u3002\r\n      );\r\n  }\r\n}\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"2_%E9%96%A2%E6%95%B0%E3%82%92%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%B8\"><\/span>2. \u95a2\u6570\u3092\u30af\u30e9\u30b9\u3078<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6b21\u306b\u95a2\u6570\u3092\u30af\u30e9\u30b9\u3078\u66f8\u304d\u63db\u3048\u3066\u3044\u304d\u307e\u3059\u3002 \u66f8\u304d\u63db\u3048\u306f\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u5b9f\u65bd\u3057\u307e\u3057\u305f\u3002<\/p>\n<ol>\n<li>functions.php\u3067\u53d6\u308a\u8fbc\u307e\u308c\u308b\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3067\u30af\u30e9\u30b9\u3092\u65b0\u305f\u306b\u5b9a\u7fa9<\/li>\n<li>\u5b9a\u7fa9\u3057\u305f\u30af\u30e9\u30b9\u306b\u95a2\u6570\u3084\u30c7\u30fc\u30bf\u3092\u307e\u3068\u3081\u308b<br \/>\n    \u307e\u305f\u3001\u305d\u306e\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3067\u5225\u306e\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u308a\u8fbc\u3093\u3067\u3044\u305f\u5834\u5408\u3001\u305d\u306e\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u95a2\u6570\u3084\u5909\u6570\u3092\u30af\u30e9\u30b9\u3067\u518d\u5b9a\u7fa9(\u4e0d\u8981\u306b\u306a\u3063\u305f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u7834\u68c4)<\/li>\n<li>\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u30ad\u30e3\u30e1\u30eb\u30b1\u30fc\u30b9\u304b\u3089\u30d1\u30b9\u30ab\u30eb\u30b1\u30fc\u30b9\u306b\u5909\u66f4\u3057\u3066\u30af\u30e9\u30b9\u540d\u3068\u540c\u4e00\u306b\u4fee\u6b63<br \/>\n    functions.php\u3067\u306e\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u308a\u8fbc\u3080\u30d1\u30b9\u3092\u4fee\u6b63<\/li>\n<li>add_action\u3092\u5b9f\u884c\u3059\u308b\u95a2\u6570\u3092\u305d\u308c\u305e\u308c\u306e\u30af\u30e9\u30b9\u5185\u3067\u5b9a\u7fa9<br \/>\n    \uff08\u30a2\u30af\u30b7\u30e7\u30f3\u95a2\u6570\u3082\u6a5f\u80fd\u306e\u4e00\u90e8\u5206\u3067\u3042\u308a\u30af\u30e9\u30b9\u306b\u307e\u3068\u3081\u3066\u6271\u3044\u305f\u3044\u305f\u3081\u3002\u307e\u305f\u3001\u30af\u30e9\u30b9\u306e\u5916\u304b\u3089\u60f3\u5b9a\u5916\u306b\u95a2\u6570\u3092\u547c\u3073\u51fa\u3055\u308c\u308b\u3053\u3068\u3092\u6e1b\u3089\u3059\u3079\u304d\uff09<\/li>\n<li>\u30a2\u30af\u30bb\u30b9\u4fee\u98fe\u5b50\u3092\u8ffd\u52a0\uff08\u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30c3\u30af\u3092\u547c\u3073\u51fa\u3059\u95a2\u6570\u306b\u306f\u300cpublic\u300d\u3001\u305d\u308c\u4ee5\u5916\u306e\u5909\u6570\u3084\u95a2\u6570\u306b\u306f\u300cprivate\u300d\uff09<\/li>\n<li>functions.php\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u3001\u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30c3\u30af\u3092\u547c\u3073\u51fa\u3057\u3066\u5b9f\u884c<\/li>\n<\/ol>\n<p>\u4ee5\u4e0a\u306e\u65b9\u6cd5\u3067\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210<\/strong><\/p>\n<pre>\r\n\/path\/to\/geek\r\n        \u251c\u2500\u2500 inc\r\n        \u2502     \u251c\u2500\u2500 CreatePostType.php\r\n        \u2502     \u251c\u2500\u2500 EnqueueScripts.php\r\n        \u2502     \u251c\u2500\u2500 CreateCustomFields.php\r\n        \u2502     \u2514\u2500\u2500 SaveCustomFields.php\r\n        \u251c\u2500\u2500 functions.php\r\n        \u251c\u2500\u2500 index.php\r\n        \u2514\u2500\u2500 style.css\r\n<\/pre>\n<p>inc\/CreatePostType.php \u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<details style=\"padding: 30px; background: #F3F5F6; margin: 50px 0;\">\n<summary>inc\/CreatePostType.php \u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\uff08\u30af\u30ea\u30c3\u30af\u3067\u958b\u304d\u307e\u3059\uff09<\/summary>\n<pre>\r\n<?php\r\n\r\nclass CreatePostType\r\n{\r\n    private const POST_TYPES = [\r\n        'news' => 'NEWS',\r\n        'media' => 'Media',\r\n        'work' => 'WORK',\r\n        'office' => 'Office',\r\n    ];\r\n    \/\/\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u4f5c\u6210\r\n    private function createPostType()\r\n    {\r\n        foreach (self::POST_TYPES as $key => $post_type) {\r\n            register_post_type(\r\n                $key,\r\n                self::getPostTypeDefinition($post_type)\r\n            );\r\n            register_taxonomy(\r\n                ($key . '_cat'),\r\n                $key,\r\n                self::getTaxonomyDefinitionWhetherTagOrCat(\r\n                    '\u30ab\u30c6\u30b4\u30ea\u30fc[' . $post_type . ']',\r\n                    true\r\n                )\r\n            );\r\n            register_taxonomy(\r\n                ($key . '_tag'),\r\n                $key,\r\n                self::getTaxonomyDefinitionWhetherTagOrCat(\r\n                    '\u30bf\u30b0[' . $post_type . ']',\r\n                    false\r\n                )\r\n            );\r\n        }\r\n    }\r\n    private function getPostTypeDefinition($label)\r\n    {\r\n        return (array(\r\n            'label' => $label,\r\n            'public' => true,\r\n            'has_archive' => true,\r\n            'menu_position' => 5,\r\n            'show_in_rest' => true,\r\n            'supports' => [\r\n                'title',\r\n                'editor',\r\n                'thumbnail',\r\n                'revisions',\r\n                'excerpt',\r\n            ]\r\n        ));\r\n    }\r\n    private function getTaxonomyDefinitionWhetherTagOrCat($label, $is_hierarchical)\r\n    {\r\n        return (array(\r\n            'label' => $label,\r\n            'hierarchical' => $is_hierarchical,\r\n            'public' => true,\r\n            'show_in_rest' => true,\r\n            'update_count_callback' => $is_hierarchical == true ? '' : '_update_post_term_count',\r\n        ));\r\n    }\r\n    public function addAction()\r\n    {\r\n        add_action(\r\n            'init',\r\n            $this->createPostType(...)\r\n        );\r\n    }\r\n}\r\n<\/pre>\n<\/details>\n<p>functions.php \u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306b CreatePostType \u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u3057\u3066\u3001\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p><strong>functions.php \u3088\u308a\u629c\u7c8b<\/strong><\/p>\n<pre>\r\n<?php\r\n\r\nrequire_once __DIR__ . \"\/inc\/CreatePostType.php\"\r\n\r\n(new CreatePostType())->addAction();\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"3_namespace_%E3%82%92%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B\"><\/span>3. namespace \u3092\u8a2d\u5b9a\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6b21\u306b\u3001\u305d\u308c\u305e\u308c\u306e\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u306bnamespace5\u3092\u547d\u540d\u3057\u3066\u3001\u30ab\u30d7\u30bb\u30eb\u5316\u3092\u3057\u307e\u3059\u3002<br \/>\n\u30ab\u30d7\u30bb\u30eb\u5316\u3092\u3059\u308b\u3053\u3068\u3067\u95a2\u6570\u540d\u3084\u30af\u30e9\u30b9\u540d\u3067\u306e\u885d\u7a81\u3092\u9632\u304e\u307e\u3059\u3002<br \/>\n\u307e\u305f\u5f8c\u8ff0\u3059\u308b\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p>namespace \u306f declare \u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f8b\u5916\u3068\u3057\u3066\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5148\u982d\u306b\u8a18\u8ff0\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\n\u79c1\u306f namespace \u3092\u968e\u5c64\u69cb\u9020\u3067\u5ba3\u8a00\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><strong>createPostType.php \u306b namespace \u3092\u5ba3\u8a00<\/strong><\/p>\n<pre>\r\n<?php\r\n\r\nnamespace Geek\\Inc; \/\/\u8ffd\u52a0\u3057\u305f\u6587\r\n\r\nrequire_once __DIR__ . \"\/inc\/getPostTypeDefinition.php\"\r\nrequire_once __DIR__ . \"\/inc\/getTaxonomyDefinitionWhetherTagOrCat.php\"\r\n$POST_TYPES = [\/* \u30c7\u30fc\u30bf\u306e\u5024\u306b\u5909\u66f4\u306f\u3042\u308a\u307e\u305b\u3093\u3002 *\/];\r\nfunction createPostType(){\/* \u51e6\u7406\u5185\u5bb9\u306b\u5909\u66f4\u306f\u3042\u308a\u307e\u305b\u3093\u3002 *\/}\r\n<\/pre>\n<p>use \u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3063\u3066 functions.php \u304b\u3089\u30af\u30e9\u30b9\u3092\u547c\u3073\u51fa\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>functions.php \u3067 use \u3092\u8a18\u8ff0<\/strong><\/p>\n<pre>\r\n<?php\r\n\/* \u3053\u3053\u304b\u3089\u8ffd\u52a0\u3057\u305f *\/\r\n\r\nuse  Geek\\Inc\\{\r\n  EnqueueScripts,\r\n  CreatePostType,\r\n  CreateCustomFields,\r\n  SaveCustomFields,\r\n};\r\n\/* \u3053\u3053\u307e\u3067\u8ffd\u52a0\u3057\u305f *\/\r\nrequire_once __DIR__ . \"\/inc\/enqueueScripts.php\"\r\nrequire_once __DIR__ . \"\/inc\/createPostType.php\"\r\nrequire_once __DIR__ . \"\/inc\/createCustomFields.php\"\r\nrequire_once __DIR__ . \"\/inc\/saveCustomFields.php\"\r\n\r\n\/* \u4ee5\u964d\u3001\u5b9f\u884c\u51e6\u7406 *\/\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"4_PHP_%E3%82%B3%E3%83%BC%E3%83%87%E3%82%A3%E3%83%B3%E3%82%B0%E8%A6%8F%E7%B4%84%E3%81%AB%E5%89%87%E3%81%A3%E3%81%A6%E6%95%B4%E5%BD%A2\"><\/span>4. PHP \u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u5247\u3063\u3066\u6574\u5f62<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u73fe\u6bb5\u968e\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u8907\u6570\u4f5c\u6210\u3057\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3057\u307e\u3057\u305f\u3002\u3053\u3053\u3067\u3044\u3063\u305f\u3093\u3001\u30b3\u30fc\u30c9\u6574\u5f62\u306b\u8a71\u3092\u5909\u3048\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3059\u308b\u3046\u3048\u3067\u300c\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u300d\u3068\u3044\u3046\u30eb\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30eb\u30fc\u30eb\u306f\u3001\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u304c\u66f8\u3044\u305f\u3068\u3057\u3066\u3082\u3001\u8ab0\u304c\u898b\u3066\u3082\u5206\u304b\u308b\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u306b\u306a\u308b\u3088\u3046\u306b\u5b9a\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u4ee3\u8868\u7684\u306a PHP \u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306e 1 \u3064\u3067\u3042\u308b\u300cPSR-12\u300d\u306b\u6cbf\u3063\u3066\u30b3\u30fc\u30c9\u6574\u5f62\u3092\u3057\u307e\u3059\u3002<sup>[<a href=\"#reference\">^6<\/a>]<\/sup><br \/>\n\u305f\u3060\u3057\u3001\u76ee\u8996\u3068\u624b\u4f5c\u696d\u3067\u30eb\u30fc\u30eb\u306b\u6cbf\u3063\u3066\u3044\u308b\u304b\u30c1\u30a7\u30c3\u30af\u3059\u308b\u306e\u306f\u5927\u5909\u306a\u306e\u3067\u3001\u81ea\u52d5\u3067\u898f\u7d04\u30c1\u30a7\u30c3\u30af\u3068\u6574\u5f62\u3092\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u306b\u3001Composer \u304b\u3089 PHP_CodeSniffer \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<sup>[<a href=\"#reference\">^7<\/a>]<\/sup><br \/>\nDocker Desktop \u3092\u8d77\u52d5\u3057\u3001WordPress\u30b3\u30f3\u30c6\u30ca\u306eTerminal\u3067\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3061\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306e\u30c1\u30a7\u30c3\u30af\u3068\u30b3\u30fc\u30c9\u6574\u5f62\u3092\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30b3\u30f3\u30c6\u30ca\u306e\/var\/www\/html \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067 Composer \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/li>\n<li>Composer \u30b3\u30de\u30f3\u30c9\u3067 PHP_CodeSniffer \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/li>\n<li>\u4f5c\u6210\u3055\u308c\u305f .\/vendor\/bin \u76f4\u4e0b\u306b phpcs, phpcbf \u304c\u3042\u308b\u304b\u78ba\u8a8d\u3059\u308b\u3002<\/li>\n<li>phpcs \u5b9f\u884c\u3067\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306e\u30c1\u30a7\u30c3\u30af\u3001phpcbf \u5b9f\u884c\u3067\u30b3\u30fc\u30c9\u6574\u5f62\u3092\u3059\u308b\u3002<\/li>\n<\/ol>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001Composer \u306e\u5c0e\u5165(\u624b\u9806 1.)\u3092\u5272\u611b\u3057\u3001\u624b\u9806 2.\u3088\u308a\u8aac\u660e\u3057\u307e\u3059\u3002<sup>[<a href=\"#reference\">^8<\/a>]<\/sup><\/p>\n<p>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u3059\u308b\u3053\u3068\u3067\u3001\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b composer.json, composer.lock, vendor \u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>\r\ncomposer require \"squizlabs\/php_codesniffer\"\r\n<\/pre>\n<p>\u300c-h\u300d\u3067 phpcs\u3001phpcbf\u306e\u30b3\u30de\u30f3\u30c9\u30d8\u30eb\u30d7\u3092\u958b\u3051\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u300c-i\u300d\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u300cpsr12\u300d\u304c\u3042\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>\r\n.\/vendor\/bin\/phpcs -h\r\n.\/vendor\/bin\/phpcbf -h\r\n.\/vendor\/bin\/phpcs -i\r\n.\/vendor\/bin\/phpcbf -i\r\n<\/pre>\n<p>functions.php \u3068 inc \u76f4\u4e0b\u306e PHP \u30d5\u30a1\u30a4\u30eb\u306b\u898f\u7d04\u30c1\u30a7\u30c3\u30af\u3092\u3059\u308b\u3068\u304d\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3061\u307e\u3059\u3002<\/p>\n<pre>\r\n.\/vendor\/bin\/phpcs --standard=psr12 .\/wp-content\/themes\/geek\/functions.php\r\n.\/vendor\/bin\/phpcs --standard=psr12 .\/wp-content\/themes\/geek\/inc\/*.php\r\n<\/pre>\n<p>\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u6574\u5f62\u3059\u308b\u5834\u5408\u306f\u300c.\/vendor\/bin\/phpcbf\u300d\u306b\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u898f\u7d04\u30c1\u30a7\u30c3\u30af\u3067\u30a8\u30e9\u30fc\u304c\u7121\u304f\u306a\u3063\u305f\u3089\u6b21\u306e\u5de5\u7a0b\u306b\u9032\u307f\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_require_%E3%81%AB%E3%82%88%E3%82%8B%E8%AA%AD%E8%BE%BC%E5%9B%9E%E6%95%B0%E3%82%92%E6%B8%9B%E3%82%89%E3%81%99\"><\/span>5. require \u306b\u3088\u308b\u8aad\u8fbc\u56de\u6570\u3092\u6e1b\u3089\u3059<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>PHP \u306b\u306f\u300cPSR-4\u300d\u3068\u3044\u3046\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u3068\u547c\u3070\u308c\u308b\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u306e\u81ea\u52d5\u8aad\u307f\u8fbc\u307f\u306b\u95a2\u3059\u308b\u4ed5\u69d8\u304c\u3042\u308a\u307e\u3059\u3002<sup>[<a href=\"#reference\">^9<\/a>]<\/sup><\/p>\n<p>\u3053\u306e\u300cPSR-4\u300d\u306f\u300cnamespace \u306e\u4fee\u98fe\u90e8\u5206\u3092\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u57fa\u6e96\u306b\u3057\u305f\u76f8\u5bfe\u30d1\u30b9\u3068\u3057\u3066\u3001\u30af\u30e9\u30b9\u540d\u3092\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u3057\u3066\u5bfe\u5fdc\u3059\u308b\u300d\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<sup>[<a href=\"#reference\">^10<\/a>]<\/sup><\/p>\n<p>\u73fe\u6bb5\u968e\u306e functions.php \u306f\u30af\u30e9\u30b9\u306e\u547c\u3073\u51fa\u3057\u56de\u6570\u5206\u3001require \u3068 use \u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u5fc5\u8981\u306a\u30af\u30e9\u30b9\u304c\u5897\u3048\u3066\u3044\u304f\u305f\u3073\u306b\u8aad\u307f\u306b\u304f\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002 \u305d\u3053\u3067\u3001\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u6a5f\u80fd\u3067 use \u30ad\u30fc\u30ef\u30fc\u30c9\u304b\u3089\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3088\u3046\u306b\u3057\u3066\u3001\u8aad\u307f\u306b\u304f\u3055\u3092\u56de\u907f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001composer.json \u3092\u7834\u68c4\u3057\u3001\u521d\u671f\u5316\u3067\u6539\u3081\u3066\u65b0\u898f\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\ncomposer \u306e\u521d\u671f\u8a2d\u5b9a\u306e\u9014\u4e2d\u3067 PSR-4 \u306e\u8a2d\u5b9a\u3092\u805e\u304b\u308c\u308b\u306e\u3067\u3001\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u3055\u305b\u308b\u30d1\u30b9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\ncomposer init\r\n\r\nAdd PSR-4 autoload mapping? Maps namespace \"Root\\html\" to the entered relative path. [src\/, n to skip]: wp-content\/themes\/geek\/inc\/\r\n<\/pre>\n<p>\u65b0\u898f\u4f5c\u6210\u3055\u308c\u305f composer.json \u3092\u78ba\u8a8d\u3059\u308b\u3068\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u306e\u9805\u76ee\u304c\u3042\u308b\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u7de8\u96c6\u3057\u3001\u4fdd\u5b58\u3092\u3057\u307e\u3059\u3002<\/p>\n<p><strong>composer.json<\/strong><\/p>\n<pre>\r\ncomposer dump-autoload\r\nGenerating autoload files\r\nGenerated autoload files\r\n<\/pre>\n<p>fuctions.php\u3067vendor\u76f4\u4e0b\u306b\u3042\u308bautoload.php \u3092\u8aad\u307f\u8fbc\u307e\u305b\u308b\u3088\u3046\u306b\u8ffd\u8a18\u3057\u307e\u3059\u3002<\/p>\n<p>functions.php\u306b\u8ffd\u8a18\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307e\u305b\u307e\u3059\u3002<\/p>\n<pre>\r\ncomposer dump-autoload\r\nGenerating autoload files\r\nGenerated autoload files\r\n<\/pre>\n<p>\u4eca\u5f8c\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3067\u30af\u30e9\u30b9\u306e\u51e6\u7406\u306a\u3069\u3092\u5909\u66f4\u3057\u305f\u3089\u3001\u5148\u307b\u3069\u306e\u30b3\u30de\u30f3\u30c9\u3067\u518d\u8aad\u307f\u8fbc\u307f\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3053\u308c\u3067require\u3092\u66f8\u304b\u305a\u306b\u5916\u90e8\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%88%86%E5%89%B2%E5%BE%8C%E3%81%AE_functionsphp\"><\/span>\u5206\u5272\u5f8c\u306e functions.php<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4ee5\u4e0a\u306e\u5de5\u7a0b\u3067\u3001functions.php\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u5f53\u521d\u306e\u30b3\u30fc\u30c9\u3068\u6bd4\u3079\u308b\u3068\u3001functions.php\u306e\u4e2d\u8eab\u304c\u304b\u306a\u308a\u30b9\u30c3\u30ad\u30ea\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre>\r\n<?php\r\n\r\nuse  Geek\\Inc\\{\r\n  EnqueueScripts,\r\n  CreatePostType,\r\n  CreateCustomFields,\r\n  SaveCustomFields,\r\n};\r\n\r\nrequire_once $_SERVER['DOCUMENT_ROOT']. ('\/vendor\/autoload.php');\r\n\/\/ \u30c6\u30fc\u30de\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u8aad\u307f\u8fbc\u3080\r\n(new EnqueueScripts())->addAction();\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u4f5c\u6210\r\n(new CreatePostType())->addAction();\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4f5c\u6210\r\n(new CreateCustomFields())->addAction();\r\n\/\/\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u4fdd\u5b58\r\n(new SaveCustomFields())->addAction();\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E3%81%BE%E3%81%A8%E3%82%81\"><\/span>\u307e\u3068\u3081<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>functions.php\u306e\u8a18\u8ff0\u91cf\u3092\u6e1b\u3089\u3057\u305f\u308a\u3001\u53ef\u8aad\u6027\u3092\u4e0a\u3052\u305f\u308a\u3059\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u3092\u884c\u3044\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>\u6a5f\u80fd\u3054\u3068\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u5206\u5272\u3057\u3001\u30af\u30e9\u30b9\u306b\u307e\u3068\u3081\u308b\u3002<\/li>\n<li>\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3057\u305f\u3089\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u306b\u6cbf\u3063\u3066\u3044\u308b\u304b\u4fee\u6b63\u3059\u308b\u3002<\/li>\n<li>\u30aa\u30fc\u30c8\u30ed\u30fc\u30c9\u6a5f\u80fd\u3092\u6d3b\u7528\u3059\u308b\u3002<\/li>\n<\/ul>\n<p>\u672c\u8a18\u4e8b\u304c\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n<h2 id=\"reference\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83%E8%A8%98%E4%BA%8B_URL\"><\/span>\u53c2\u8003\u8a18\u4e8b URL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>1. <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/wp_enqueue_style\/\" target=\"_blank\" rel=\"noopener\">wp_enqueue_style() | Function | WordPress Developer Resources<\/a><br \/>\n2. <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/register_post_type\/\" target=\"_blank\" rel=\"noopener\">register_post_type() | Function | WordPress Developer Resources<\/a><br \/>\n3. <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/add_meta_box\/\" target=\"_blank\" rel=\"noopener\">add_meta_box() | Function | WordPress Developer Resources<\/a><br \/>\n4. <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/update_post_meta\/\" target=\"_blank\" rel=\"noopener\">update_post_meta() | Function | WordPress Developer Resources<\/a><br \/>\n5. <a href=\"https:\/\/www.php.net\/manual\/ja\/language.namespaces.rationale.php\" target=\"_blank\" rel=\"noopener\">PHP: \u540d\u524d\u7a7a\u9593\u306e\u6982\u8981 - Manual<\/a><br \/>\n6. <a href=\"https:\/\/www.php-fig.org\/psr\/psr-12\/\" target=\"_blank\" rel=\"noopener\">PSR-12: Extended Coding Style - PHP-FIG<\/a><br \/>\n7. <a href=\"https:\/\/github.com\/squizlabs\/PHP_CodeSniffer\" target=\"_blank\" rel=\"noopener\">squizlabs\/PHP_CodeSniffer: PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.<\/a><br \/>\n8. <a href=\"https:\/\/getcomposer.org\/download\" target=\"_blank\" rel=\"noopener\">Composer<\/a><br \/>\n9. <a href=\"https:\/\/www.php-fig.org\/psr\/psr-4\/\" target=\"_blank\" rel=\"noopener\">PSR-4: Autoloader - PHP-FIG<\/a><br \/>\n10. <a href=\"https:\/\/getcomposer.org\/doc\/04-schema.md#autoload\" target=\"_blank\" rel=\"noopener\">The composer.json schema - Composer<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u958b\u767a\u3092\u9032\u3081\u3066\u3044\u304f\u3046\u3048\u3067\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u9577\u304f\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002\u305d\u308c\u306ffunctions.php\u306b\u3082\u8a00\u3048\u308b\u3053\u3068\u3060\u3068\u601d\u3044\u307e\u3059\u3002\u672c\u8a18\u4e8b\u3067\u306ffunctions.php\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u51e6\u7406\u3060\u3051\u306b\u306a\u308b\u3088\u3046\u306b\u5206\u5272\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u79c1\u306e\u65b9\u6cd5\u304c\u53c2\u8003\u306b\u306a\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5551,"parent":0,"menu_order":0,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"class_list":["post-5552","customize","type-customize","status-publish","format-standard","has-post-thumbnail","hentry"],"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"\u682a\u5f0f\u4f1a\u793e\u30c7\u30b8\u30bf\u30eb\u30a2\u30a4\u30c7\u30f3\u30c6\u30a3\u30c6\u30a3 wp.geek\u7de8\u96c6\u90e8\"\/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"wp.geek | wp.geek\u3067\u306fWordPress\u306b\u95a2\u3059\u308b\u69d8\u3005\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u307e\u3059\u3002\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u3067\u306e\u30b5\u30a4\u30c8\u5236\u4f5c\u306b\u643a\u308f\u308b\u5168\u3066\u306e\u65b9\u306b\u5f79\u7acb\u3064\u60c5\u5831\u3092\u3054\u63d0\u4f9b\u3057\u3066\u3044\u304d\u307e\u3059\u3002\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"WordPress\u30c6\u30fc\u30de\u306efunctions.php\u3092\u898b\u3084\u3059\u304f\u3059\u308b | wp.geek\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2023\/09\/wp3.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2023\/09\/wp3.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-09-29T04:23:43+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-10-23T09:03:43+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"WordPress\u30c6\u30fc\u30de\u306efunctions.php\u3092\u898b\u3084\u3059\u304f\u3059\u308b | wp.geek\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2023\/09\/wp3.jpg\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"WordPress\u30c6\u30fc\u30de\u306efunctions.php\u3092\u898b\u3084\u3059\u304f\u3059\u308b | wp.geek","description":"","canonical_url":false,"robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"ja_JP","og:site_name":"wp.geek | wp.geek\u3067\u306fWordPress\u306b\u95a2\u3059\u308b\u69d8\u3005\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u307e\u3059\u3002\u30ef\u30fc\u30c9\u30d7\u30ec\u30b9\u3067\u306e\u30b5\u30a4\u30c8\u5236\u4f5c\u306b\u643a\u308f\u308b\u5168\u3066\u306e\u65b9\u306b\u5f79\u7acb\u3064\u60c5\u5831\u3092\u3054\u63d0\u4f9b\u3057\u3066\u3044\u304d\u307e\u3059\u3002","og:type":"article","og:title":"WordPress\u30c6\u30fc\u30de\u306efunctions.php\u3092\u898b\u3084\u3059\u304f\u3059\u308b | wp.geek","og:image":"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2023\/09\/wp3.jpg","og:image:secure_url":"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2023\/09\/wp3.jpg","og:image:width":1200,"og:image:height":800,"article:published_time":"2023-09-29T04:23:43+00:00","article:modified_time":"2023-10-23T09:03:43+00:00","twitter:card":"summary_large_image","twitter:title":"WordPress\u30c6\u30fc\u30de\u306efunctions.php\u3092\u898b\u3084\u3059\u304f\u3059\u308b | wp.geek","twitter:image":"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2023\/09\/wp3.jpg"},"aioseo_meta_data":{"post_id":"5552","title":null,"description":null,"keywords":[],"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":[],"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"WebPage","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"limit_modified_date":false,"created":"2023-09-29 04:22:59","updated":"2023-10-23 09:16:54","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"_links":{"self":[{"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize\/5552","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize"}],"about":[{"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/types\/customize"}],"author":[{"embeddable":true,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":9,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize\/5552\/revisions"}],"predecessor-version":[{"id":5699,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize\/5552\/revisions\/5699"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/media\/5551"}],"wp:attachment":[{"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/media?parent=5552"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/categories?post=5552"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}