{"id":6809,"date":"2024-06-14T17:31:08","date_gmt":"2024-06-14T08:31:08","guid":{"rendered":"https:\/\/wpmake.jp\/contents\/?post_type=customize&#038;p=6809"},"modified":"2024-06-14T17:31:08","modified_gmt":"2024-06-14T08:31:08","slug":"edit_page_customize_description-2","status":"publish","type":"customize","link":"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/","title":{"rendered":"WordPress\u306e\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u307f\u308b\u3010\u5f8c\u7de8 \u301c\u5b9f\u8df5\u301c\u3011"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_71 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\/edit_page_customize_description-2\/#%E3%81%AF%E3%81%98%E3%82%81%E3%81%AB\" title=\"\u306f\u3058\u3081\u306b\">\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\/edit_page_customize_description-2\/#WP_List_Table%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%A8%E3%81%9D%E3%81%AE%E6%8B%A1%E5%BC%B5%E3%82%AF%E3%83%A9%E3%82%B9\" title=\"WP_List_Table\u30af\u30e9\u30b9\u3068\u305d\u306e\u62e1\u5f35\u30af\u30e9\u30b9\">WP_List_Table\u30af\u30e9\u30b9\u3068\u305d\u306e\u62e1\u5f35\u30af\u30e9\u30b9<\/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\/edit_page_customize_description-2\/#WP_Posts_List_Table%E3%82%AF%E3%83%A9%E3%82%B92\" title=\"WP_Posts_List_Table\u30af\u30e9\u30b9[^2]\">WP_Posts_List_Table\u30af\u30e9\u30b9[^2]<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#display_row%E3%83%A1%E3%82%BD%E3%83%83%E3%83%89%E3%81%AE%E6%AF%94%E8%BC%833\" title=\"display_row()\u30e1\u30bd\u30c3\u30c9\u306e\u6bd4\u8f03[^3]\">display_row()\u30e1\u30bd\u30c3\u30c9\u306e\u6bd4\u8f03[^3]<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#single_row%E3%83%A1%E3%82%BD%E3%83%83%E3%83%89%E3%81%AE%E6%AF%94%E8%BC%83\" title=\"single_row()\u30e1\u30bd\u30c3\u30c9\u306e\u6bd4\u8f03\">single_row()\u30e1\u30bd\u30c3\u30c9\u306e\u6bd4\u8f03<\/a><\/li><\/ul><\/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\/edit_page_customize_description-2\/#%E6%8A%95%E7%A8%BF%E4%B8%80%E8%A6%A7%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E7%B7%A8%E9%9B%86%E3%81%99%E3%82%8B\" title=\"\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u3059\u308b\">\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u3059\u308b<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#WP_List_Table%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B4\" title=\"WP_List_Table\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b[^4]\">WP_List_Table\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b[^4]<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#%E6%89%8B%E9%A0%86%EF%BC%91%E3%80%80WP_List_Table%E3%82%92%E7%B6%99%E6%89%BF%E3%83%BB%E6%8B%A1%E5%BC%B5\" title=\"\u624b\u9806\uff11\u3000WP_List_Table\u3092\u7d99\u627f\u30fb\u62e1\u5f35\">\u624b\u9806\uff11\u3000WP_List_Table\u3092\u7d99\u627f\u30fb\u62e1\u5f35<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#%E6%89%8B%E9%A0%86%EF%BC%92_%E7%AE%A1%E7%90%86%E7%94%BB%E9%9D%A2%E3%81%AB%E8%A1%A8%E7%A4%BA\" title=\"\u624b\u9806\uff12 \u7ba1\u7406\u753b\u9762\u306b\u8868\u793a\">\u624b\u9806\uff12 \u7ba1\u7406\u753b\u9762\u306b\u8868\u793a<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#%E3%81%BE%E3%81%A8%E3%82%81\" title=\"\u307e\u3068\u3081\">\u307e\u3068\u3081<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description-2\/#%E5%8F%82%E8%80%83%E8%A8%98%E4%BA%8B\" title=\"\u53c2\u8003\u8a18\u4e8b\">\u53c2\u8003\u8a18\u4e8b<\/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>\u3053\u306e\u8a18\u4e8b\u306f\u3001<a href=\"https:\/\/wpmake.jp\/contents\/customize\/edit_page_customize_description\/\">WordPress\u306e\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u307f\u308b\u3010\u524d\u7de8 \u301cedit.php\u89e3\u8aac\u301c\u3011<\/a>\u306e\u7d9a\u304d\u306b\u306a\u308a\u307e\u3059\u3002 \u524d\u56de\u306e\u8aac\u660e\u3067\u306f\u3001edit.php\u306e\u4e2d\u8eab\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u4eca\u56de\u306f\u3001edit.php\u306e\u30ea\u30b9\u30c8\u90e8\u5206\u3092\u8868\u793a\u3059\u308b\u969b\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308bWP_List_Table\u30af\u30e9\u30b9\u3068\u305d\u306e\u62e1\u5f35\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u306e\u89e3\u8aac\u3068\u3001WP_List_Table\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u7ba1\u7406\u753b\u9762\u3092\u4f5c\u6210\u3059\u308b\u624b\u9806\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"WP_List_Table%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%A8%E3%81%9D%E3%81%AE%E6%8B%A1%E5%BC%B5%E3%82%AF%E3%83%A9%E3%82%B9\"><\/span>WP_List_Table\u30af\u30e9\u30b9\u3068\u305d\u306e\u62e1\u5f35\u30af\u30e9\u30b9<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u524d\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001\u4e00\u89a7\u30da\u30fc\u30b8\u306e\u8868\u793a\u306b\u306fWP_List_Table\u30af\u30e9\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3057\u305f\u3002<sup>[<a href=\"#reference\">^1<\/a>]<\/sup>\u3057\u304b\u3057\u3001\u5168\u3066\u306e\u4e00\u89a7\u30da\u30fc\u30b8\u3067\u3053\u306e\u30af\u30e9\u30b9\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u304b\u3068\u3044\u3046\u3068\u305d\u3046\u3067\u306f\u306a\u304f\u3001\u6295\u7a3f\u30da\u30fc\u30b8\u3067\u306fWP_Posts_List_Table\u3001\u30e1\u30c7\u30a3\u30a2\u30da\u30fc\u30b8\u3067\u306f WP_Media_List_Table\u30af\u30e9\u30b9\u3068\u3044\u3063\u305f\u3001WP_List_Table\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u305f\u30af\u30e9\u30b9\u304c\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002 \u4eca\u56de\u306fWP_Posts_List_Table\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h3><span class=\"ez-toc-section\" id=\"WP_Posts_List_Table%E3%82%AF%E3%83%A9%E3%82%B92\"><\/span>WP_Posts_List_Table\u30af\u30e9\u30b9<sup>[<a href=\"#reference\">^2<\/a>]<\/sup><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>WP_Post_List_Table\u30af\u30e9\u30b9\u306f\u3001\u6295\u7a3f\u306e\u4e00\u89a7\u30da\u30fc\u30b8\u306e\u8868\u793a\u306b\u4f7f\u308f\u308c\u308b\u30af\u30e9\u30b9\u3067\u3001WP_List_Table\u30af\u30e9\u30b9\u3092\u62e1\u5f35\u3057\u305f\u3082\u306e\u3067\u3059\u3002\u62e1\u5f35\u30af\u30e9\u30b9\u3067\u3042\u308b\u305f\u3081\u3001\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u3084\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u540d\u524d\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u4e2d\u8eab\u304c\u7570\u306a\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002 \u5927\u304d\u306a\u9055\u3044\u304c\u751f\u307e\u308c\u3066\u3044\u308b\u306e\u306f\u3001display_rows()\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"display_row%E3%83%A1%E3%82%BD%E3%83%83%E3%83%89%E3%81%AE%E6%AF%94%E8%BC%833\"><\/span>display_row()\u30e1\u30bd\u30c3\u30c9\u306e\u6bd4\u8f03<sup>[<a href=\"#reference\">^3<\/a>]<\/sup><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><strong>\u30fbWP_List_Table<\/strong><\/p>\n<pre>\r\npublic function display_rows() {\r\n\tforeach ( $this->items as $item ) {\r\n\t\t$this->single_row( $item );\r\n\t}\r\n}\r\n<\/pre>\n<p><strong>\u30fbWP_Posts_list_Table<\/strong><\/p>\n<pre>\r\npublic function display_rows( $posts = array(), $level = 0 ) {\r\n\tglobal $wp_query, $per_page;\r\n\r\n\tif ( empty( $posts ) ) {\r\n\t\t$posts = $wp_query->posts;\r\n\t}\r\n\r\n\tadd_filter( 'the_title', 'esc_html' );\r\n\r\n\tif ( $this->hierarchical_display ) {\r\n\t\t$this->_display_rows_hierarchical( $posts, $this->get_pagenum(), $per_page );\r\n\t} else {\r\n\t\t$this->_display_rows( $posts, $level );\r\n\t}\r\n}\r\n\r\nprivate function _display_rows( $posts, $level = 0 ) {\r\n\t$post_type = $this->screen->post_type;\r\n\r\n\t$post_ids = array();\r\n\r\n\tforeach ( $posts as $a_post ) {\r\n\t\t$post_ids[] = $a_post->ID;\r\n\t}\r\n\r\n\tif ( post_type_supports( $post_type, 'comments' ) ) {\r\n\t\t$this->comment_pending_count = get_pending_comments_num( $post_ids );\r\n\t}\r\n\tupdate_post_author_caches( $posts );\r\n\r\n\tforeach ( $posts as $post ) {\r\n\t\t$this->single_row( $post, $level );\r\n\t}\r\n}\r\n<\/pre>\n<p>\u30b3\u30fc\u30c9\u3092\u898b\u308c\u3070\u3001display_rows()\u30e1\u30bd\u30c3\u30c9\u306e\u4e2d\u8eab\u304c\u5927\u304d\u304f\u5909\u308f\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u308f\u304b\u308a\u307e\u3059\u3002WP_List_Table\u3067\u306f\u3001single_row()\u30e1\u30bd\u30c3\u30c9\u3092foreach\u3067\u5b9f\u884c\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u304c\u3001WP_Posts_List_Table\u30af\u30e9\u30b9\u3067\u306f\u3001_display_ro()\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u3001\u3055\u3089\u306b\u305d\u306e\u4e2d\u3067single_row()\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u5f15\u6570\u3092\u898b\u308c\u3070\u308f\u304b\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3082\u4e2d\u8eab\u304c\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"single_row%E3%83%A1%E3%82%BD%E3%83%83%E3%83%89%E3%81%AE%E6%AF%94%E8%BC%83\"><\/span>single_row()\u30e1\u30bd\u30c3\u30c9\u306e\u6bd4\u8f03<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><strong>\u30fbWP_List_Table<\/strong><\/p>\n<pre>\r\npublic function single_row( $item ) {\r\n\techo '<tr>';\r\n\t$this->single_row_columns( $item );\r\n\techo '<\/tr>';\r\n}\r\n\r\nprotected function single_row_columns( $item ) {\r\n\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\r\n\r\n\tforeach ( $columns as $column_name => $column_display_name ) {\r\n\t\t$classes = \"$column_name column-$column_name\";\r\n\t\tif ( $primary === $column_name ) {\r\n\t\t\t$classes .= ' has-row-actions column-primary';\r\n\t\t}\r\n\r\n\t\tif ( in_array( $column_name, $hidden, true ) ) {\r\n\t\t\t$classes .= ' hidden';\r\n\t\t}\r\n\r\n\t\t\/*\r\n\t\t * Comments column uses HTML in the display name with screen reader text.\r\n\t\t * Strip tags to get closer to a user-friendly string.\r\n\t\t *\/\r\n\t\t$data = 'data-colname=\"' . esc_attr( wp_strip_all_tags( $column_display_name ) ) . '\"';\r\n\r\n\t\t$attributes = \"class='$classes' $data\";\r\n\r\n\t\tif ( 'cb' === $column_name ) {\r\n\t\t\techo '<th scope=\"row\" class=\"check-column\">';\r\n\t\t\techo $this->column_cb( $item );\r\n\t\t\techo '<\/th>';\r\n\t\t} elseif ( method_exists( $this, '_column_' . $column_name ) ) {\r\n\t\t\techo call_user_func(\r\n\t\t\t\tarray( $this, '_column_' . $column_name ),\r\n\t\t\t\t$item,\r\n\t\t\t\t$classes,\r\n\t\t\t\t$data,\r\n\t\t\t\t$primary\r\n\t\t\t);\r\n\t\t} elseif ( method_exists( $this, 'column_' . $column_name ) ) {\r\n\t\t\techo \"<td $attributes>\";\r\n\t\t\techo call_user_func( array( $this, 'column_' . $column_name ), $item );\r\n\t\t\techo $this->handle_row_actions( $item, $column_name, $primary );\r\n\t\t\techo '<\/td>';\r\n\t\t} else {\r\n\t\t\techo \"<td $attributes>\";\r\n\t\t\techo $this->column_default( $item, $column_name );\r\n\t\t\techo $this->handle_row_actions( $item, $column_name, $primary );\r\n\t\t\techo '<\/td>';\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<p><strong>\u30fbWP_Posts_list_Table<\/strong><\/p>\n<pre>\r\npublic function single_row( $post, $level = 0 ) {\r\n\t$global_post = get_post();\r\n\r\n\t$post                = get_post( $post );\r\n\t$this->current_level = $level;\r\n\r\n\t$GLOBALS['post'] = $post;\r\n\tsetup_postdata( $post );\r\n\r\n\t$classes = 'iedit author-' . ( get_current_user_id() === (int) $post->post_author ? 'self' : 'other' );\r\n\r\n\t$lock_holder = wp_check_post_lock( $post->ID );\r\n\r\n\tif ( $lock_holder ) {\r\n\t\t$classes .= ' wp-locked';\r\n\t}\r\n\r\n\tif ( $post->post_parent ) {\r\n\t\t$count    = count( get_post_ancestors( $post->ID ) );\r\n\t\t$classes .= ' level-' . $count;\r\n\t} else {\r\n\t\t$classes .= ' level-0';\r\n\t}\r\n\t?>\r\n\t<tr id=\"post-<?php echo $post->ID; ?>\" class=\"<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>\">\r\n\t\t<?php $this->single_row_columns( $post ); ?>\r\n\t<\/tr>\r\n\t<?php\r\n\t$GLOBALS['post'] = $global_post;\r\n}\r\n<\/pre>\n<p>WP_List_Table\u3067\u306f\u3001$item\u306b\u5165\u3063\u305f\u5024\u3092\u5f15\u6570\u306b\u3057\u3066single_row_columns()\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u304c\u3001WP_Posts_List_Table\u3067\u306f\u3001get_post()\u30e1\u30bd\u30c3\u30c9\u3067\u6295\u7a3f\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u3092\u5f15\u6570\u306b\u3057\u3066single_row_columns()\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002single_row_columns()\u30e1\u30bd\u30c3\u30c9\u306fWP_List_Table\u30af\u30e9\u30b9\u306e\u3082\u306e\u304c\u7d99\u627f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E6%8A%95%E7%A8%BF%E4%B8%80%E8%A6%A7%E3%83%9A%E3%83%BC%E3%82%B8%E3%82%92%E7%B7%A8%E9%9B%86%E3%81%99%E3%82%8B\"><\/span>\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u3059\u308b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u306b\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u30af\u30e9\u30b9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u305f\u306e\u3067\u3001\u6b21\u306f\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u3057\u3066\u898b\u307e\u3057\u3087\u3046\u3002\u6295\u7a3f\u4e00\u89a7\u30da\u30fc\u30b8\u306b\u306fWP_Post_List_Table\u30af\u30e9\u30b9\u304c\u65e2\u306b\u3042\u308b\u306e\u3067\u3001\u65b0\u3057\u304f\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u30da\u30fc\u30b8\u306e\u7de8\u96c6\u306b\u306f\u3001\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u629c\u7c8b\u3092\u9805\u76ee\u306b\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002 \u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092functions.php\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\nfunction add_post_columns( $columns ) {\r\n\t$add_columns = array( 'excerpt' => '\u629c\u7c8b');\r\n\t$columns = array_merge( $columns , $add_columns);\r\n\t\r\n\treturn $columns;\r\n}\r\n\r\nadd_filter('manage_posts_columns' , 'add_post_columns');\r\n\r\nfunction add_post_custom_columns ( $columns, $postid ) {\r\n  if ($columns === 'excerpt') {\r\n    echo get_the_excerpt( $postid );\r\n  }\r\n}\r\n\r\nadd_action( 'manage_posts_custom_column', add_post_custom_columns(...),10,2);\r\n<\/pre>\n<p>\u3059\u308b\u3068\u3001\u3053\u306e\u3088\u3046\u306b\u9805\u76ee\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/add_table_column.png\" alt=\"\" width=\"1084\" height=\"506\" class=\"alignnone size-full wp-image-6811\" srcset=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/add_table_column.png 1084w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/add_table_column-300x140.png 300w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/add_table_column-1024x478.png 1024w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/add_table_column-768x358.png 768w\" sizes=\"(max-width: 1084px) 100vw, 1084px\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"WP_List_Table%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B4\"><\/span>WP_List_Table\u3092\u4f7f\u7528\u3057\u3066\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b<sup>[<a href=\"#reference\">^4<\/a>]<\/sup><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u6b21\u306b\u3001\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002 \u4eca\u56de\u306f\u3001\u6295\u7a3f\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\u3001\u30ab\u30b9\u30bf\u30e0\u6295\u7a3f\u304c\u5168\u3066\u8868\u793a\u3055\u308c\u308b\u4e00\u89a7\u30ea\u30b9\u30c8\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"%E6%89%8B%E9%A0%86%EF%BC%91%E3%80%80WP_List_Table%E3%82%92%E7%B6%99%E6%89%BF%E3%83%BB%E6%8B%A1%E5%BC%B5\"><\/span>\u624b\u9806\uff11\u3000WP_List_Table\u3092\u7d99\u627f\u30fb\u62e1\u5f35<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre>\r\nclass WP_All_Posts_List_Table extends WP_List_Table {\r\n  public function __construct() {\r\n    parent::__construct();\r\n  }\r\n  private function set_posts() {\r\n    global $wp_post_types;\r\n    $all_posts = [];\r\n    foreach ($wp_post_types as $post_type) {\r\n      $posts = get_posts(array('post_type' => $post_type->name));\r\n      foreach($posts as $post) {\r\n        $obj = new stdClass();\r\n        $obj->id = $post->ID;\r\n        $obj->title = $post->post_title;\r\n        $obj->post_type = $post_type->name;\r\n        array_push($all_posts, $obj);\r\n      }\r\n    }\r\n  return $all_posts;\r\n  }\r\n\r\n  public function prepare_items() {\r\n    $columns= $this->get_columns();\r\n    $hidden= array();\r\n    $sortable= array();\r\n    $this->_column_headers= array($columns, $hidden, $sortable);\r\n    $this->items = $this->set_posts();\r\n  }\r\n\r\n  public function get_columns() {\r\n    return array(\r\n      'cb' => 'checkbox',\r\n      'id' => 'id',\r\n      'title' => 'title',\r\n      'post_type' => '\u6295\u7a3f\u30bf\u30a4\u30d7'\r\n    );\r\n  }\r\n  public function single_row($item) {\r\n        list($columns, $hidden, $sortable, $primary) = $this->get_column_info();\r\n\r\n        $id = $item->id;\r\n\r\n        echo '<tr>';\r\n        printf('<td><input type=\"checkbox\" name=\"checked[]\" value=\"%d\" \/><\/td>', $id);\r\n        printf('<td>%d<\/td>' ,$id);\r\n        printf('<td>%s<\/td>', esc_html($item->title));\r\n        printf('<td>%s<\/td>', esc_html($item->post_type));\r\n        echo '<\/tr>';\r\n\r\n    }\r\n}\r\n<\/pre>\n<p>\u30b3\u30fc\u30c9\u306e\u8aac\u660e\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002 class WP_All_Posts_List_Table extends WP_List_Table\u306f\u3001WP_List_Table\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u305fWP_All_List_Table\u30af\u30e9\u30b9\u3092\u5ba3\u8a00\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u3067\u3001WP_List_Table\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u3053\u306e\u30af\u30e9\u30b9\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u305d\u3057\u3066\u521d\u3081\u306b__construct()\u3092\u89aa\u304b\u3089\u5f15\u304d\u7d99\u304e\u307e\u3059\u3002__construct()\u306f\u3001\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u751f\u6210\u3055\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u308b\u95a2\u6570\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306bset_posts()\u306f\u3001\u3053\u306e\u30af\u30e9\u30b9\u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3001\u30c6\u30fc\u30d6\u30eb\u306b\u8868\u793a\u3059\u308b\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u5b9a\u7fa9\u3057\u307e\u3057\u305f\u3002 \u4e2d\u8eab\u3068\u3057\u3066\u306f\u3001$wp_post_types\u3067\u5168\u3066\u306e\u6295\u7a3f\u30bf\u30a4\u30d7\u3092\u914d\u5217\u3067\u53d6\u5f97\u3057\u3001foreach\u306e\u306a\u304b\u3067get_posts()\u3067\u6295\u7a3f\u3092\u53d6\u5f97\u3001\u753b\u9762\u306b\u8868\u793a\u3057\u305f\u3044id\u3001title\u3001post_type\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u5165\u3063\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u307e\u3068\u307e\u308a\u3092\u914d\u5217\u306b\u3057\u3066\u8fd4\u3059\u3001\u3068\u3044\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u6b8b\u308a\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001WP_List_Table\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3057\u3066\u3044\u307e\u3059\u3002\u30aa\u30fc\u30d0\u30e9\u30a4\u30c9\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002 prepare_items()\u306f\u3001items\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u306a\u306e\u3067\u3001\u5148\u7a0b\u306eset_posts()\u3092items\u306b\u5165\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001$columns\u306a\u3069\u306e\u5909\u6570\u306e\u5b9a\u7fa9\u3082\u3053\u3053\u3067\u884c\u3044\u307e\u3059\u3002 get_columns()\u306f\u3001\u8868\u793a\u3059\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u306e\u5185\u5bb9\u3092\u6c7a\u3081\u307e\u3059\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u5143\u3005\u306fdie()\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u306a\u306e\u3067\u3001\u5fc5\u305a\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4eca\u56de\u306fid\u3001title\u3001post_type\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u3001\u3053\u306e3\u3064\u3092\u914d\u5217\u306b\u5165\u308c\u307e\u3057\u305f\u3002 single_row()\u306e\u5909\u66f4\u306f\u3001\u4eca\u56de\u306fWordPress\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304b\u3089\u5024\u3092\u53d6\u308a\u51fa\u3059\u308f\u3051\u3067\u306f\u306a\u3044\u305f\u3081\u3001\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u4e2d\u8eab\u3068\u3057\u3066\u306f\u901a\u5e38\u306e\u3082\u306e\u3068\u3042\u307e\u308a\u5909\u308f\u308a\u307e\u305b\u3093\u304c\u3001\u53d6\u308a\u51fa\u3059\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u81ea\u5206\u3067\u5b9a\u7fa9\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u3082\u306e\u306b\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u30af\u30e9\u30b9\u306e\u5b9a\u7fa9\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002\u7ba1\u7406\u753b\u9762\u306b\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"%E6%89%8B%E9%A0%86%EF%BC%92_%E7%AE%A1%E7%90%86%E7%94%BB%E9%9D%A2%E3%81%AB%E8%A1%A8%E7%A4%BA\"><\/span>\u624b\u9806\uff12 \u7ba1\u7406\u753b\u9762\u306b\u8868\u793a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7ba1\u7406\u753b\u9762\u306b\u8868\u793a\u3059\u308b\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001add_menu_page()\u3067\u30da\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>\r\nfunction add_custom_menu() {\r\n  add_menu_page(\r\n    '\u6295\u7a3f\u30bf\u30a4\u30d7\u4e00\u89a7\u753b\u9762',\r\n    '\u3059\u3079\u3066\u306e\u6295\u7a3f',\r\n    'manage_options',\r\n    'all_post',\r\n    'create_custom_menu_content',\r\n    'dashicons-menu-alt3',\r\n    3\r\n  );\r\n};\r\n<\/pre>\n<p>\u3053\u308c\u3067\u30da\u30fc\u30b8\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u6b21\u306b\u3001\u30da\u30fc\u30b8\u3092\u8868\u793a\u3057\u305f\u969b\u547c\u3073\u51fa\u3055\u308c\u308b\u95a2\u6570\u3068\u3057\u3066\u5f15\u6570\u306b\u30bb\u30c3\u30c8\u3057\u305fcreate_custom_menu_content()\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\nfunction create_custom_menu_content() {\r\n  $list_table = new WP_All_Posts_List_Table();\r\n  $list_table->prepare_items();\r\n  $list_table->display();\r\n};\r\n\r\nadd_action('admin_menu',add_custom_menu(...), 9);\r\n<\/pre>\n<p>edit.php\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u308b\u3068\u304d\u3068\u540c\u3058\u3088\u3046\u306b\u3001\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3001prepare_items()\u3067item\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3001display()\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u7ba1\u7406\u753b\u9762\u306b\u30c6\u30fc\u30d6\u30eb\u304c\u8868\u793a\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002\u7ba1\u7406\u753b\u9762\u3092\u898b\u3066\u898b\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/custom_table.png\" alt=\"\" width=\"1566\" height=\"450\" class=\"alignnone size-full wp-image-6812\" srcset=\"https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/custom_table.png 1566w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/custom_table-300x86.png 300w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/custom_table-1024x294.png 1024w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/custom_table-768x221.png 768w, https:\/\/wpmake.jp\/contents\/wp-content\/uploads\/2024\/06\/custom_table-1536x441.png 1536w\" sizes=\"(max-width: 1566px) 100vw, 1566px\" \/><\/p>\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<ul>\n<li>\u30c6\u30fc\u30d6\u30eb\u3092\u8868\u793a\u3059\u308b\u969b\u306f\u3001WP_Posts_List_Table\u30af\u30e9\u30b9\u3084\u3001WP_Media_List_Table\u30af\u30e9\u30b9\u306a\u3069\u3001WP_List_Table\u30af\u30e9\u30b9\u306e\u62e1\u5f35\u30af\u30e9\u30b9\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u3002<\/li>\n<li>\u6295\u7a3f\u4e00\u89a7\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u7de8\u96c6\u3059\u308b\u969b\u306b\u306fmanage_posts_columns\u30d5\u30a3\u30eb\u30bf\u30fc\u30d5\u30c3\u30af\u3092funtions.php\u306b\u8a18\u8ff0\u3059\u308b\u3002<\/li>\n<li>\u81ea\u5206\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306f\u3001WP_List_Table \u30af\u30e9\u30b9\u306e\u62e1\u5f35\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001\u30e1\u30bd\u30c3\u30c9\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b\u3002<\/li>\n<\/ul>\n<h2 id=\"reference\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83%E8%A8%98%E4%BA%8B\"><\/span>\u53c2\u8003\u8a18\u4e8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_list_table\/\" target=\"_blank\" rel=\"noopener\">WP_List_Table<\/a><\/li>\n<li><a href=\"https:\/\/developer.wordpress.org\/reference\/classes\/wp_posts_list_table\/\" rel=\"noopener\" target=\"_blank\">[WP_Posts_List_Table] (https:\/\/developer.wordpress.org\/reference\/classes\/wp_posts_list_table\/)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/WordPress\/wordpress-develop\/blob\/6.4\/src\/wp-admin\/includes\/class-wp-list-table.php#L16-L1874\" target=\"_blank\" rel=\"noopener\">class-wp-list-table.php,line16-1874<\/a><\/li>\n<li><a href=\"https:\/\/make.wordpress.org\/docs\/plugin-developer-handbook\/10-plugin-components\/custom-list-table-columns\/\" target=\"_blank\" rel=\"noopener\">custom_table-list-columns<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>edit.php\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308bWP_List_Table\u30af\u30e9\u30b9\u306e\u89e3\u8aac\u3068\u3001\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u3066\u7ba1\u7406\u753b\u9762\u3092\u4f5c\u6210\u3059\u308b\u307e\u3067\u306e\u624b\u9806\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":6813,"parent":0,"menu_order":0,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"class_list":["post-6809","customize","type-customize","status-publish","format-standard","has-post-thumbnail","hentry"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize\/6809"}],"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":1,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize\/6809\/revisions"}],"predecessor-version":[{"id":6814,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/customize\/6809\/revisions\/6814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/media\/6813"}],"wp:attachment":[{"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/media?parent=6809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmake.jp\/contents\/wp-json\/wp\/v2\/categories?post=6809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}