{"id":4112,"date":"2018-06-11T17:50:16","date_gmt":"2018-06-11T08:50:16","guid":{"rendered":"http:\/\/tcd-manual.net\/?p=4112"},"modified":"2023-07-21T15:55:13","modified_gmt":"2023-07-21T06:55:13","slug":"tcd%e3%83%86%e3%83%bc%e3%83%9esource%ef%bc%9a%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%ef%bc%88%e5%88%b6%e4%bd%9c%e5%ae%9f%e7%b8%be%ef%bc%89%e3%82%92%e4%bb%96%e3%81%ae%e5%90%8d%e7%a7%b0","status":"publish","type":"post","link":"https:\/\/tcd-manual.net\/?p=4112","title":{"rendered":"TCD\u30c6\u30fc\u30deSOURCE\uff1a\u5236\u4f5c\u5b9f\u7e3e\u3092\u4ed6\u306e\u540d\u79f0\u306b\u5909\u66f4\u3057\u305f\u3044\u3002URL\u3092work\u304b\u3089\u5909\u66f4\u3057\u305f\u3044"},"content":{"rendered":"<p class=\"q_frame q_frame1\"><span class=\"q_frame_label\">\u3053\u306e\u30da\u30fc\u30b8\u3067\u306e\u3054\u6848\u5185\u5185\u5bb9<\/span>\u30fb<a href=\"#contents01\">\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f&#8221;\u5236\u4f5c\u5b9f\u7e3e&#8221;\u306e\u30c6\u30ad\u30b9\u30c8\u8868\u8a18\u3001\u304a\u3088\u3073URL\u306e\u5909\u66f4\u65b9\u6cd5<\/a><br \/>\n\u30fb<a href=\"#contents02\">\u30ab\u30b9\u30bf\u30e0\u30bf\u30af\u30bd\u30ce\u30df\u30fc&#8221;\u5236\u4f5c\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc&#8221;\u306e\u30c6\u30ad\u30b9\u30c8\u8868\u8a18\u306e\u5909\u66f4\u65b9\u6cd5<\/a>\n<\/p>\n<h2 id=\"contents01\" class=\"styled_h2\">\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f&#8221;\u5236\u4f5c\u5b9f\u7e3e&#8221;\u306e\u30c6\u30ad\u30b9\u30c8\u3001\u304a\u3088\u3073URL\u306e\u5909\u66f4\u65b9\u6cd5<\/h2>\n<h3 class=\"styled_h3\">Q.\u201d\u5236\u4f5c\u5b9f\u7e3e\u201d\u3092\u201d\u5c0e\u5165\u5b9f\u7e3e\u201d\u306b\u5909\u66f4\u3092\u884c\u3044\u305f\u3044\u3002<\/h3>\n<p>\u30fb\u30d6\u30e9\u30a6\u30b6\u30fc\u306e\u30bf\u30d6\u306e\u201d\u5236\u4f5c\u5b9f\u7e3e\u201d\u3092\u201d\u5c0e\u5165\u5b9f\u7e3e\u201d\u306b\u8868\u793a\u3055\u305b\u305f\u308a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u201d\u5236\u4f5c\u5b9f\u7e3e\u201d\u3068\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3092\u201d\u5c0e\u5165\u5b9f\u7e3e\u201d\u306b\u3059\u308b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306e\u65b9\u6cd5\u3092\u6559\u3048\u3066\u9802\u3051\u307e\u3059\u3067\u3057\u3087\u3046\u304b\uff1f<br \/>\n\u30fb\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u306e\u201d\u5236\u4f5c\u5b9f\u7e3e\u201d\u306eURL\u5909\u66f4\u65b9\u6cd5\u3092\u6559\u3048\u3066\u9802\u3051\u307e\u3059\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<h3 class=\"styled_h3\"><span>A.<\/span>\u4e0b\u8a18\u306ephp\u30d5\u30a1\u30a4\u30eb\u306e\u8a72\u5f53\u7b87\u6240\u3092\u7de8\u96c6\u3057\u307e\u3059<\/h3>\n<p><b>\u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb\uff1a<\/b>functions.php<br \/>\n<b>\u7de8\u96c6\u3059\u308b\u7b87\u6240\uff1a<\/b>480\u884c\u76ee\u4ed8\u8fd1<br \/>\n<b>__(&#8216;Work&#8217;, &#8216;tcd-w&#8217;)<\/b> \u3092 <b>__(&#8216;\u5c0e\u5165\u5b9f\u7e3e&#8217;, &#8216;tcd-w&#8217;)<\/b>\u306b\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u3001\u4e0b\u8a18\u30b3\u30fc\u30c926\u884c\u76ee\u306e<strong>&#8216;slug&#8217; => &#8216;work&#8217;<\/strong>\u3092<strong>&#8216;slug&#8217; => &#8216;product&#8217;<\/strong>\u5909\u66f4\u3059\u308b\u3068\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u30b9\u30e9\u30c3\u30b0\u3092product\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [5,6,19,26]; title: ; notranslate\" title=\"\">\r\n\/\/ \u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u3000\u300cWork\u300d\u3092\u8ffd\u52a0 ----------------------------------------------------------------\r\n\r\nif ( function_exists('register_post_type') ) {\r\n $labels = array(\r\n  'name' =&gt; __('\u5c0e\u5165\u5b9f\u7e3e', 'tcd-w'),\r\n  'singular_name' =&gt; __('\u5c0e\u5165\u5b9f\u7e3e', 'tcd-w'),\r\n  'add_new' =&gt; __('Add New', 'tcd-w'),\r\n  'add_new_item' =&gt; __('Add New Item', 'tcd-w'),\r\n  'edit_item' =&gt; __('Edit', 'tcd-w'),\r\n  'new_item' =&gt; __('New item', 'tcd-w'),\r\n  'view_item' =&gt; __('View Item', 'tcd-w'),\r\n  'search_items' =&gt; __('Search Items', 'tcd-w'),\r\n  'not_found' =&gt; __('Not Found', 'tcd-w'),\r\n  'not_found_in_trash' =&gt; __('Not found in trash', 'tcd-w'), \r\n  'parent_item_colon' =&gt; ''\r\n );\r\n\r\n register_post_type('work', array(\r\n  'label' =&gt; __('\u5c0e\u5165\u5b9f\u7e3e', 'tcd-w'),\r\n  'labels' =&gt; $labels,\r\n  'public' =&gt; true,\r\n  'publicly_queryable' =&gt; true,\r\n  'menu_position' =&gt; 5,\r\n  'show_ui' =&gt; true,\r\n  'query_var' =&gt; true,\r\n  'rewrite' =&gt; array('slug' =&gt; 'product'),\r\n  'capability_type' =&gt; 'post',\r\n  'has_archive' =&gt; true,\r\n  'hierarchical' =&gt; true,\r\n  'supports' =&gt; array('title','editor','thumbnail')\r\n ));\r\n};\r\n<\/pre>\n<p>\u203b\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u5909\u66f4\u3092\u4f34\u3044\u307e\u3059\u306e\u3067\u3001\u4ee5\u524d\u306e\u30b9\u30e9\u30c3\u30b0\u306f\u4f7f\u7528\u4e0d\u53ef\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4e0a\u8a18\u5909\u66f4\u306b\u3088\u308a404\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u969b\u306f\u3000\u8a2d\u5b9a\uff1e\u30d1\u30fc\u30de\u30ea\u30f3\u30af\u8a2d\u5b9a\u3067\u5909\u66f4\u3092\u4fdd\u5b58\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u307e\u3059\u3002\uff08\u8a2d\u5b9a\u5909\u66f4\u306f\u4e0d\u8981\u3067\u3001\u305f\u3060\u4fdd\u5b58\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3060\u3051\u3067\u7d50\u69cb\u3067\u3059\u3002\uff09<\/p>\n<p>\u4ed6\u306e\u30c6\u30fc\u30de\u306b\u3064\u3044\u3066\u306f\u3053\u3061\u3089\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<br \/>\n<a href=\"https:\/\/tcd-manual.net\/?p=2899\" rel=\"noopener\" target=\"_blank\">TCD\u5168\u30c6\u30fc\u30de\u5171\u901a\uff1a\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u30bf\u30a4\u30d7\u3067\u81ea\u52d5\u7684\u306b\u8868\u793a\u3055\u308c\u308b\u6587\u8a00\u3068\u30b9\u30e9\u30c3\u30b0\uff08URL\uff09\u3092\u5909\u66f4\u3059\u308b\u65b9\u6cd5<\/a><\/p>\n<h2 id=\"contents02\" class=\"styled_h2\">\u30ab\u30b9\u30bf\u30e0\u30bf\u30af\u30bd\u30ce\u30df\u30fc&#8221;\u5236\u4f5c\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc&#8221;\u306e\u30c6\u30ad\u30b9\u30c8\u8868\u8a18\u306e\u5909\u66f4\u65b9\u6cd5<\/h2>\n<h3 class=\"styled_h3\"><span>Q.<\/span>\u300c\u5236\u4f5c\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc\u300d\u306e\u8868\u8a18\u3092\u300c\u5c0e\u5165\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc\u300d\u306b\u5909\u3048\u305f\u3044\u3067\u3059\u3002<\/h3>\n<p>\u30fb\u30ab\u30c6\u30b4\u30ea\u30fc\u30da\u30fc\u30b8\u306etitle\u30bf\u30b0\u306e\u8868\u8a18\u300c\u5236\u4f5c\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc\u300d\u306e\u8868\u8a18\u3092\u5909\u66f4\u3057\u305f\u3044\u3067\u3059\u3002<br \/>\n\u30fb\u30ab\u30c6\u30b4\u30ea\u30fc\u30da\u30fc\u30b8\u306e\u30d6\u30e9\u30a6\u30b6\u306e\u30bf\u30b0\u306e\u8868\u8a18\u300c\u5236\u4f5c\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc\u300d\u306e\u8868\u8a18\u3092\u5909\u66f4\u3057\u305f\u3044\u3067\u3059\u3002<\/p>\n<h3 class=\"styled_h3\"><span>A.<\/span>\u4e0b\u8a18\u306ephp\u30d5\u30a1\u30a4\u30eb\u306e\u8a72\u5f53\u7b87\u6240\u3092\u7de8\u96c6\u3057\u307e\u3059<\/h3>\n<p><b>\u7de8\u96c6\u3059\u308b\u30d5\u30a1\u30a4\u30eb\uff1a<\/b>functions.php<br \/>\n<b>\u7de8\u96c6\u3059\u308b\u7b87\u6240\uff1a<\/b>513\u884c\u76ee\u4ed8\u8fd1<br \/>\n<b>__(&#8216;Work category&#8217;, &#8216;tcd-w&#8217;)<\/b> \u3092 <b>__(&#8216;\u5c0e\u5165\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc&#8217;, &#8216;tcd-w&#8217;)<\/b>\u306b\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: php; highlight: [3,5,6]; title: ; notranslate\" title=\"\">\r\n\/\/ Work\u7528\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u8ffd\u52a0\r\n$args_menu_category = array(\r\n    'label' =&gt; __('\u5c0e\u5165\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc', 'tcd-w'),\r\n    'labels' =&gt; array(\r\n      'name' =&gt; __('\u5c0e\u5165\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc', 'tcd-w'),\r\n      'singular_name' =&gt; __('\u5c0e\u5165\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc', 'tcd-w'),\r\n      'search_items' =&gt; __('Search category', 'tcd-w'),\r\n      'popular_items' =&gt; __('Popular category', 'tcd-w'),\r\n      'all_items' =&gt; __('All category', 'tcd-w'),\r\n      'parent_item' =&gt; __('Parent category', 'tcd-w'),\r\n      'edit_item' =&gt; __('Edit category', 'tcd-w'),\r\n      'update_item' =&gt; __('Update category', 'tcd-w'),\r\n      'add_new_item' =&gt; __('Add New category', 'tcd-w'),\r\n      'new_item_name' =&gt; __('Name of new category', 'tcd-w'),\r\n    ),\r\n    'public' =&gt; true,\r\n    'show_ui' =&gt; true,\r\n    'show_admin_column' =&gt; true,\r\n    'hierarchical' =&gt; true,\r\n    'rewrite' =&gt; array('hierarchical' =&gt; false ),\r\n);\r\nregister_taxonomy('work-cat', 'work', $args_menu_category);\r\n<\/pre>\n<p class=\"q_frame q_frame2\"><span class=\"q_frame_label\">\u88dc\u8db3<\/span>\u4e0a\u8a1822\u884c\u76ee<strong>register_taxonomy(&#8216;work-cat&#8217;, &#8216;work&#8217;, $args_menu_category)<\/strong>\u306e<strong>work-cat<\/strong>\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u3001\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u30b9\u30e9\u30c3\u30b0\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u304c\u3001\u4e00\u89a7\u30da\u30fc\u30b8(archive-work.php)\u3084\u30d1\u30f3\u304f\u305a\u30ea\u30b9\u30c8\u306a\u3069\u306e\u8868\u793a\u306b\u5f71\u97ff\u304c\u51fa\u307e\u3059\u306e\u3067\u3001\u5909\u66f4\u306f\u304a\u3059\u3059\u3081\u3057\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u3053\u306e\u30da\u30fc\u30b8\u3067\u306e\u3054\u6848\u5185\u5185\u5bb9\u30fb\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f&#8221;\u5236\u4f5c\u5b9f\u7e3e&#8221;\u306e\u30c6\u30ad\u30b9\u30c8\u8868\u8a18\u3001\u304a\u3088\u3073URL\u306e\u5909\u66f4\u65b9\u6cd5 \u30fb\u30ab\u30b9\u30bf\u30e0\u30bf\u30af\u30bd\u30ce\u30df\u30fc&#8221;\u5236\u4f5c\u5b9f\u7e3e\u30ab\u30c6\u30b4\u30ea\u30fc&#8221;\u306e\u30c6\u30ad\u30b9\u30c8\u8868\u8a18\u306e\u5909\u66f4\u65b9\u6cd5 \u30ab\u30b9\u30bf\u30e0\u6295\u7a3f [&hellip;]","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[467],"tags":[350],"class_list":["post-4112","post","type-post","status-publish","format-standard","hentry","category-tcd045","tag-350"],"_links":{"self":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts\/4112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4112"}],"version-history":[{"count":0,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=\/wp\/v2\/posts\/4112\/revisions"}],"wp:attachment":[{"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tcd-manual.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}