{"id":4517,"date":"2023-06-29T00:01:41","date_gmt":"2023-06-28T15:01:41","guid":{"rendered":"http:\/\/www.lining-moon.casa\/andplus.co.jp_230822_230809\/?p=4517"},"modified":"2026-01-08T11:14:51","modified_gmt":"2026-01-08T02:14:51","slug":"post-4517","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/post-4517\/","title":{"rendered":"WordPress\u306e\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u306e\u30ab\u30b9\u30bf\u30de\u30a4\u30ba"},"content":{"rendered":"<p>WordPress\u306f\u9ad8\u3044\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u6027\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u7279\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u306f\u305d\u306e\u4e00\u4f8b\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u306b\u9069\u7528\u3059\u308b\u65b9\u6cd5\u3092\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306e\u8aac\u660e\u3092\u8868\u793a\u3059\u308b<\/h2>\n<p>\u307e\u305a\u3001WordPress\u306e\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306b\u8aac\u660e\u3092\u8868\u793a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u306f\u30ab\u30b9\u30bf\u30e0\u30a6\u30a9\u30fc\u30ab\u30fc\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u53ef\u80fd\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u305d\u306e\u30b3\u30fc\u30c9\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"language-php\"><code>\n\/* \u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u306e\u8aac\u660e\u3092\u8868\u793a\u3059\u308b *\/\nclass Description_Walker extends Walker_Nav_Menu {\n  function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {\n    global $wp_query;\n    $indent = ($depth) ? str_repeat(\"\\t\", $depth) : '';\n\n    $class_names = $value = '';\n\n    $classes = empty($item-&gt;classes) ? array() : (array) $item-&gt;classes;\n\n    $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));\n    $class_names = ' class=\"' . esc_attr($class_names) . '\"';\n\n    $output .= $indent . '&lt;li id=\"menu-item-' . $item-&gt;ID . '\"' . $value . $class_names . '&gt;';\n\n    $attributes = !empty($item-&gt;attr_title) ? ' title=\"' . esc_attr($item-&gt;attr_title) . '\"' : '';\n    $attributes .= !empty($item-&gt;target) ? ' target=\"' . esc_attr($item-&gt;target) . '\"' : '';\n    $attributes .= !empty($item-&gt;xfn) ? ' rel=\"' . esc_attr($item-&gt;xfn) . '\"' : '';\n    $attributes .= !empty($item-&gt;url) ? ' href=\"' . esc_attr($item-&gt;url) . '\"' : '';\n\n    $description = !empty($item-&gt;description) ? '&lt;span class=\"menu-walker\"&gt;' . esc_attr($item-&gt;description) . '&lt;\/span&gt;' : '';\n\n    $item_output = $args-&gt;before;\n    $item_output .= '&lt;a' . $attributes . '&gt;';\n    $item_output .= $args-&gt;link_before . apply_filters('the_title', $item-&gt;title, $item-&gt;ID);\n    $item_output .= $description . $args-&gt;link_after;\n    $item_output .= '&lt;\/a&gt;';\n    $item_output .= $args-&gt;after;\n\n    $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);\n  }\n}\n<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u65b0\u3057\u3044\u30ab\u30b9\u30bf\u30e0\u30a6\u30a9\u30fc\u30ab\u30fc\u3092\u4f5c\u6210\u3057\u3001\u5404\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306eHTML\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u307e\u3059\u3002\u5177\u4f53\u7684\u306b\u306f\u3001\u5404\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306e\u8aac\u660e\uff08\u8a2d\u5b9a\u3057\u305f\u5834\u5408\uff09\u3092\u3001<code>&lt;span class=\"menu-walker\"&gt;<\/code>\u30bf\u30b0\u3067\u56f2\u3093\u3067\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30e1\u30cb\u30e5\u30fc\u306e\u30ea\u30f3\u30af\u306b\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3059\u308b<\/h2>\n<p>\u6b21\u306b\u3001\u30e1\u30cb\u30e5\u30fc\u306e\u5404\u30ea\u30f3\u30af\u306b\u7279\u5b9a\u306e\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u306f\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3066\u9054\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"language-php\"><code>\nfunction add_class_menulink($item_output, $item) {\n  return preg_replace('\/(&lt;a.*?)\/', '$1' . ' class=&quot;menu-link&quot;', $item_output);\n}\nadd_filter('walker_nav_menu_start_el', 'add_class_menulink', 10, 4);\n<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u306f\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u3092\u4f7f\u7528\u3057\u3066\u3001\u30e1\u30cb\u30e5\u30fc\u306e\u5404\u30ea\u30f3\u30af\u306b<code>menu-link<\/code>\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30bf\u30a4\u30c8\u30eb\u5c5e\u6027\u3092\u5229\u7528\u3059\u308b<\/h2>\n<p>\u6700\u5f8c\u306b\u3001\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306b\u8a2d\u5b9a\u3055\u308c\u305f\u30bf\u30a4\u30c8\u30eb\u5c5e\u6027\u3092\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u308c\u3082\u30ab\u30b9\u30bf\u30e0\u30a6\u30a9\u30fc\u30ab\u30fc\u3092\u4f7f\u7528\u3057\u3066\u9054\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"language-php\"><code>\n$attributes = !empty($item->attr_title) ? ' title=\"' . esc_attr($item->attr_title) . '\"' : '';\n<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u884c\u306f\u3001\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306b\u30bf\u30a4\u30c8\u30eb\u5c5e\u6027\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306e\u307f\u3001\u305d\u306e\u5c5e\u6027\u3092\u30ea\u30f3\u30af\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0a\u304c\u4eca\u56de\u7d39\u4ecb\u3057\u305f\u4e3b\u8981\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u65b9\u6cd5\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u30b3\u30fc\u30c9\u306f\u3001WordPress\u30b5\u30a4\u30c8\u306e\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u3092\u5f37\u529b\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u305f\u3081\u306e\u4e00\u4f8b\u3067\u3001\u3053\u308c\u3089\u3092\u53c2\u8003\u306b\u81ea\u5206\u3060\u3051\u306e\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>","protected":false},"excerpt":{"rendered":"WordPress\u306f\u9ad8\u3044\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u6027\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u7279\u306b\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u306f\u305d\u306e\u4e00\u4f8b\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001\u3055\u307e\u3056\u307e\u306a\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u306b\u9069\u7528\u3059\u308b\u65b9\u6cd5\u3092\u8a73\u3057\u304f\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002 &nbsp; \u30e1\u30cb\u30e5\u30fc\u9805\u76ee\u306e\u8aac\u660e\u3092\u8868[...]","protected":false},"author":1,"featured_media":4718,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":{"0":"post-4517","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-php"},"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/4517","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=4517"}],"version-history":[{"count":1,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/4517\/revisions"}],"predecessor-version":[{"id":10358,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/4517\/revisions\/10358"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=4517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=4517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=4517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}