{"id":1208,"date":"2024-07-30T10:32:50","date_gmt":"2024-07-30T01:32:50","guid":{"rendered":"https:\/\/shinke1987.net\/?p=1208"},"modified":"2024-07-30T10:32:51","modified_gmt":"2024-07-30T01:32:51","slug":"wordpress%e3%81%ae%e3%82%af%e3%83%a9%e3%82%b7%e3%83%83%e3%82%af%e3%83%86%e3%83%bc%e3%83%9e%e8%87%aa%e4%bd%9c%e6%99%82%e3%81%ae%e5%80%8b%e4%ba%ba%e7%9a%84tips","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=1208","title":{"rendered":"WordPress\u306e\u30af\u30e9\u30b7\u30c3\u30af\u30c6\u30fc\u30de\u81ea\u4f5c\u6642\u306e\u500b\u4eba\u7684Tips"},"content":{"rendered":"\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u7ba1\u7406\u753b\u9762\u3067\u30b5\u30a4\u30c9\u30e1\u30cb\u30e5\u30fc\u306e\u7279\u5b9a\u306e\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30e1\u30cb\u30e5\u30fc\u3092\u524a\u9664\u3059\u308b<\/h2>\n\n\n\n<h3 id=\"toc1\" class=\"wp-block-heading\">\u524a\u9664\u3057\u305f\u3044\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30e1\u30cb\u30e5\u30fc\u306emenu_slug\u306e\u5024\u3092\u78ba\u8a8d<\/h3>\n\n\n\n<p>functions.php \u306b\u3066\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction removeAdminMenu() {\n    global $menu;\n    $temp = &#x5B;];\n    foreach ($menu as $menuElement) {\n        $temp&#x5B;] = &#x5B;\n            &#039;\u9805\u76ee&#039; =&gt; $menuElement&#x5B;0],\n            &#039;menu_slug&#039; =&gt; $menuElement&#x5B;2],\n        ];\n    };\n    var_dump($temp);\n}\n\nadd_action(&#039;admin_menu&#039;, &#039;removeAdminMenu&#039;);\n<\/pre><\/div>\n\n\n<p>\u30ed\u30b0\u30a4\u30f3\u5f8c\u3001Web\u30d6\u30e9\u30a6\u30b6\u3067\u7ba1\u7406\u753b\u9762\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306b\u4e0b\u8a18\u306e\u30a2\u30c9\u30ec\u30b9\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhttps:\/\/\u30b5\u30a4\u30c8\u306eURL\/wp-admin\n<\/pre><\/div>\n\n\n<p><\/p>\n\n\n\n<p>\u4e0b\u8a18\u753b\u50cf\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"689\" src=\"https:\/\/shinke1987.net\/wp-content\/uploads\/2024\/07\/3a786e905fc2cc2f795786dfe1737d80-1024x689.png\" alt=\"\" class=\"wp-image-1209\" srcset=\"https:\/\/shinke1987.net\/wp-content\/uploads\/2024\/07\/3a786e905fc2cc2f795786dfe1737d80-1024x689.png 1024w, https:\/\/shinke1987.net\/wp-content\/uploads\/2024\/07\/3a786e905fc2cc2f795786dfe1737d80-300x202.png 300w, https:\/\/shinke1987.net\/wp-content\/uploads\/2024\/07\/3a786e905fc2cc2f795786dfe1737d80-768x517.png 768w, https:\/\/shinke1987.net\/wp-content\/uploads\/2024\/07\/3a786e905fc2cc2f795786dfe1737d80.png 1325w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u305f\u3089\u3001\u4f8b\u3048\u3070\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30e1\u30cb\u30e5\u30fc\u306e\u300c\u30e1\u30c7\u30a3\u30a2\u300d\u3092\u524a\u9664\u3057\u305f\u3044\u306a\u3089\u3001<br>menu_slug \u306f upload.php \u306a\u306e\u3067\u3001remove_menu_page\u95a2\u6570\u306bupload.php\u3092\u6307\u5b9a\u3059\u308c\u3070\u826f\u3044\u3068\u308f\u304b\u308b\u3002<\/p>\n\n\n\n<h3 id=\"toc2\" class=\"wp-block-heading\">\u5b9f\u969b\u306b\u524a\u9664<\/h3>\n\n\n\n<p>\u4e0a\u8a18\u306emenu_slug\u3092\u78ba\u8a8d\u3059\u308b\u30b3\u30fc\u30c9\u3092\u524a\u9664\u3057\u3001\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092functions.php\u3078\u8ffd\u52a0\u3059\u308c\u3070\u826f\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/ \u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30e1\u30cb\u30e5\u30fc\u306e\u300c\u30e1\u30c7\u30a3\u30a2\u300d\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u3002\nfunction removeAdminMenu() {\n    remove_menu_page(&#039;upload.php&#039;);\n}\n\nadd_action(&#039;admin_menu&#039;, &#039;removeAdminMenu&#039;);\n<\/pre><\/div>\n\n\n<h2 id=\"toc3\" class=\"wp-block-heading\">\u6307\u5b9a\u3057\u305f\u30d5\u30c3\u30af\u306b\u767b\u9332\u3055\u308c\u305f\u95a2\u6570\u540d\u3092\u8868\u793a<\/h2>\n\n\n\n<p>\u6b21\u306e\u30b3\u30fc\u30c9\u3092functions.php\u306b\u3066\u5b9f\u884c\u3059\u308b\u3068\u8868\u793a\u3055\u308c\u308b\u304c\u3001\u7d50\u5c40IDE\u306e\u30d6\u30ec\u30a4\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u4f7f\u3046\u3053\u3068\u306b\u306a\u308b\u306f\u305a\u3002<\/p>\n\n\n\n<p>\u30d5\u30c3\u30af\u306b\u3088\u3063\u3066\u306fvar_dump\u3067\u8868\u793a\u3067\u304d\u306a\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nfunction showFuncInHook() {\n    global $wp_filter;\n    var_dump($wp_filter&#x5B;current_filter()]-&gt;callbacks);\n}\n\nadd_action(&#039;\u30d5\u30c3\u30af\u540d&#039;, &#039;showFuncInHook&#039;);\n<\/pre><\/div>\n\n\n<h2 id=\"toc4\" class=\"wp-block-heading\">sitemap.xml \u306eURL\u3092\u78ba\u8a8d<\/h2>\n\n\n\n<p>\u6b21\u306e\u30b3\u30fc\u30c9\u3092functions.php\u7b49\u3067\u30d6\u30ec\u30a4\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u7f6e\u3057\u3066\u5b9f\u884c\u3057\u305f\u308a\u3001\u8868\u793a\u3059\u308b\u3068\u826f\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nget_sitemap_url(&#039;index&#039;);\n<\/pre><\/div>\n\n\n<h2 id=\"toc5\" class=\"wp-block-heading\">\u30af\u30a8\u30ea\u30d1\u30e9\u30e1\u30fc\u30bf\u306epaged\u306b\u5b58\u5728\u3059\u308b\u306f\u305a\u306e\u30da\u30fc\u30b8\u756a\u53f7\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u610f\u56f3\u3057\u306a\u3044index.php\u7b49\u304c\u8868\u793a\u3055\u308c\u308b<\/h2>\n\n\n\n<p>\u7ba1\u7406\u753b\u9762 \u2192 \u8a2d\u5b9a \u2192 \u8868\u793a\u8a2d\u5b9a \u2192 1\u30da\u30fc\u30b8\u306b\u8868\u793a\u3059\u308b\u6700\u5927\u6295\u7a3f\u6570\u304c\u3001WP_Query\u306epaged\u3067\u6307\u5b9a\u3057\u305f\u6570\u5024\u3088\u308a\u5927\u304d\u3044\u5834\u5408\u306b\u8d77\u3053\u308b\u3002<\/p>\n\n\n\n<p>\u57fa\u672c\u7684\u306bWP_Query\u306epaged\u306f\u6307\u5b9a\u3057\u306a\u3044\u65b9\u304c\u826f\u3044\u3002<\/p>\n\n\n\n<h2 id=\"toc6\" class=\"wp-block-heading\">\u30ab\u30c6\u30b4\u30ea\u30da\u30fc\u30b8\u7b49\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30bf\u30b0\u306ethe_date()\u3092\u5229\u7528\u6642\u3001\u540c\u3058\u5e74\u6708\u65e5\u3060\u30682\u756a\u76ee\u4ee5\u964d\u304c\u8868\u793a\u3055\u308c\u306a\u3044<\/h2>\n\n\n\n<p>\u8a18\u4e8b\u304c\u4e00\u89a7\u8868\u793a\u3055\u308c\u308b\u30da\u30fc\u30b8\u3067\u3001\u540c\u4e00\u306e\u4f5c\u6210\u5e74\u6708\u65e5\u306e\u8a18\u4e8b\u304c\u3042\u3063\u305f\u5834\u5408\u30012\u756a\u76ee\u4ee5\u964d\u306e\u8a18\u4e8b\u306e\u4f5c\u6210\u5e74\u6708\u65e5\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u5bfe\u7b56\u3068\u3057\u3066\u3001the_date()\u306e\u4ee3\u308f\u308a\u306b\u4e0b\u8a18\u3092\u4f7f\u3046\u3068\u826f\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nthe_time(&#039;Y-m-d&#039;);\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>\u7ba1\u7406\u753b\u9762\u3067\u30b5\u30a4\u30c9\u30e1\u30cb\u30e5\u30fc\u306e\u7279\u5b9a\u306e\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30e1\u30cb\u30e5\u30fc\u3092\u524a\u9664\u3059\u308b \u524a\u9664\u3057\u305f\u3044\u30c8\u30c3\u30d7\u30ec\u30d9\u30eb\u30e1\u30cb\u30e5\u30fc\u306emenu_slug\u306e\u5024\u3092\u78ba\u8a8d functions.php \u306b\u3066\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002 \u30ed\u30b0\u30a4\u30f3\u5f8c\u3001Web\u30d6\u30e9\u30a6\u30b6\u3067\u7ba1\u7406\u753b\u9762\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[50],"class_list":["post-1208","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1208"}],"version-history":[{"count":5,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions"}],"predecessor-version":[{"id":1269,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions\/1269"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}