{"id":46130,"date":"2016-04-18T07:12:47","date_gmt":"2016-04-18T07:12:47","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=46130"},"modified":"2018-07-14T09:38:23","modified_gmt":"2018-07-14T09:38:23","slug":"create-admin-tables-using-wp_list_table-class","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/","title":{"rendered":"Create Admin tables using WP_List_Table CLASS"},"content":{"rendered":"<p>Create Admin tables using WP_List_Table CLASS &#8211; In WordPress <strong>WP_List_Table<\/strong> Class is used to display data, e.g. users, plugins, comments, or posts.<br \/>\nEach post type that has a dashboard uses the WP_List_Table class to display data.<\/p>\n<p>We uses WP_List_Table class so that we can display\u00a0 custom post type data at wordpress backend.<br \/>\nIn the WordPress dashboard, the tables that displays the posts, pages and user data are all created internally by WordPress using the <strong>WP_List_Table<\/strong> class.<br \/>\nThey are used on nearly all default admin pages with lists, and most of the developers often integrate them into their plugins<\/p>\n<div class=\"alert alert-danger\">WP_List_Table class access is marked as private. That means it is not intended for use by plugin and theme developers as it is subject to change without warning in any future WordPress release. If you would still like to make use of the class, you should make a copy to use and distribute with your own project, or else use it at your own risk.<\/div>\n<p>Even After this confimation from wordpress.org, the <strong>WP_List_Table<\/strong> class has become widely used by plugins and WordPress developers as it provides a reliable, consistent, and semantic way to create custom list tables in WordPress. Till date, no major changes have occurred in this class or are scheduled to occur, so testing your plugin with beta\/RC phases of WordPress development should be more than enough to avoid any major issues.<\/p>\n<p>If you are still feeling risk of using this class a common (and safe) workaround is to make a copy the <strong>WP_List_Table<\/strong> class <strong>( \/wp-admin\/includes\/class-wp-list-table.php )<\/strong> to use and distribute in your plugins, instead of using the original core class. This way, if the core class should ever change, your plugins will continue to work as-is.<\/p>\n<p>Let&#8217;s get started with <strong>WP_List_Table<\/strong> class :-<\/p>\n<div class=\"alert alert-info\">Register admin menu<\/div>\n<p>We need to Register admin menu using <strong>admin_menu<\/strong> hook<\/p>\n<pre class=\"brush:php\">if ( current_user_can('edit_files') ) {\r\n\r\n  add_action( 'admin_menu','register_my_custom_menu_page');\r\n}<\/pre>\n<div class=\"alert alert-info\">Using load hook<\/div>\n<p>We need to create admin menu, sub-menus and using load-hook and current_screen hook we can add option and set help tab for admin menu we have created<\/p>\n<pre class=\"brush:php\">function register_my_custom_menu_page(){\r\n\r\n    global $new_menu_page;\r\n    \r\n   \/\/ creating admin menu \r\n\r\n    add_menu_page('Career', 'Career', 'edit_posts','career','custom_list_page', get_template_directory_uri().'\/images\/custom.png', 8 );\r\n\r\n    $hook=add_submenu_page(\"career\",\"Custom List\",\"Custom List\",'edit_posts', \"career\", \"custom_list_page\");\r\n \r\n   \/\/ adding submenu \r\n   \r\n   add_submenu_page(\"career\",\"Custom Detail\",\"Custom Detail\",'edit_posts',\"custom_detail\", \"custom_detail_page\");\r\n\r\n   \/\/ creating options like per page data(pagination)\r\n \r\n    add_action( \"load-\".$hook, 'add_options' ); \r\n\r\n   \/\/ Creating help tab \r\n\r\n    add_action( 'current_screen','my_admin_add_help_tab');\r\n    \r\n}\r\nfunction my_admin_add_help_tab() {\r\n\r\n    $screen = get_current_screen();\r\n\r\n    \/\/ Add my_help_tab if current screen is My Admin Page\r\n\r\n    $screen-&gt;add_help_tab( array(\r\n\r\n        'id'    =&gt; 'my_help_tab',\r\n\r\n        'title' =&gt; 'Webkul Help Tab',\r\n\r\n        'content'   =&gt; '&lt;p&gt;' . __( 'Help Topics Added Here.' ) . '&lt;\/p&gt;',\r\n ) );\r\n }\r\nfunction add_options() {\r\n\r\n$option = 'per_page';\r\n\r\n$args = array(\r\n\r\n'label' =&gt; 'Results',\r\n\r\n'default' =&gt; 10,\r\n\r\n'option' =&gt; 'results_per_page'\r\n\r\n);\r\n\r\nadd_screen_option( $option, $args );\r\n\r\n}\r\n<\/pre>\n<div class=\"alert alert-info\">check if\u00a0<strong>WP_List_Table<\/strong> class exists<\/div>\n<p>Checking if\u00a0<strong>WP_List_Table<\/strong> already exists<\/p>\n<pre class=\"brush:php\">function custom_list_page(){\r\n\r\nif(!class_exists('Link_List_Table')){\r\n\r\n   require_once( ABSPATH . 'wp-admin\/includes\/class-wp-list-table.php' );\r\n\r\n}\r\nclass Link_List_Table extends WP_List_Table {\r\n\r\n\r\n\r\n   \/**\r\n    * Constructor, we override the parent to pass our own arguments\r\n    * We usually focus on three parameters: singular and plural labels, as well as whether the class supports AJAX.\r\n    *\/\r\n\r\n    function __construct() {\r\n\r\n       parent::__construct( array(\r\n\r\n            'singular'  =&gt; 'singular_name',     \/\/singular name of the listed records\r\n\r\n            'plural'    =&gt; 'plural_name',    \/\/plural name of the listed records\r\n\r\n            'ajax'      =&gt; false \r\n\r\n      ) );\r\n\r\n    }\r\n\r\n}\r\n\r\n\r\n    $wp_list_table = new Link_List_Table();  \r\n\r\n                 if( isset($_GET['s']) ){\r\n\r\n                $wp_list_table-&gt;prepare_items($_GET['s']);\r\n\r\n        } else {\r\n\r\n                $wp_list_table-&gt;prepare_items();\r\n\r\n        }\r\n \r\n?&gt;\r\n\r\n<\/pre>\n<form method=\"GET\"><input name=\"page\" type=\"hidden\" value=\"&lt;?php echo $_REQUEST['page'] ?&gt;\" \/> <!--?php $wp_list_table-&gt;search_box('Search column name', 'search-id'); $wp_list_table-&gt;display(); ?--><\/form>\n<p>} function custom_detail_page(){ \/\/ Add some form and store that data in database and then use that data inside custom_list_page() function }<\/p>\n<div class=\"alert alert-info\">Setup Default Columns for <strong>wp admin table<\/strong><\/div>\n<pre class=\"brush:php\">    public function column_default( $item, $column_name )\r\n\r\n      {\r\n\r\n        switch( $column_name ) {\r\n\r\n            case 'first_column_name':\r\n\r\n            case 'second_column_name':\r\n\r\n            case 'third_column_name':\r\n\r\n            case 'fourth_column_name':\r\n\r\n                return \"&lt;strong&gt;\".$item[$column_name].\"&lt;\/strong&gt;\";\r\n                    \r\n\r\n            default:\r\n\r\n                return print_r( $item, true ) ;\r\n\r\n        }\r\n\r\n    }<\/pre>\n<div class=\"alert alert-info\">Setting Sortable Columns<\/div>\n<p>Setting up sortable columns using \u00a0<strong>get_sortable_columns()<\/strong><\/p>\n<pre class=\"brush:php\">\/**\r\n\r\n * Decide which columns to activate the sorting functionality on\r\n\r\n * @return array $sortable, the array of columns that can be sorted by the user\r\n\r\n *\/\r\n\r\npublic function get_sortable_columns() {\r\n\r\n     $sortable_columns = array(\r\n\r\n            'first_column_name'     =&gt; array('first_column_name',true),\r\n           \r\n            'second_column_name' =&gt; array('second_column_name',true) ); \r\n\r\n            return $sortable_columns;\r\n }<\/pre>\n<div class=\"alert alert-info\">Setup the Hidden Columns<\/div>\n<pre class=\"brush:php\">public function get_hidden_columns()\r\n\r\n    {\r\n        \/\/ Setup Hidden columns and return them\r\n        return array();\r\n\r\n    }<\/pre>\n<div class=\"alert alert-info\">Setup Actions for particular Column<\/div>\n<pre class=\"brush:php\">      \/**\r\n     * [OPTIONAL] this is example, how to render column with actions,\r\n     * when you hover row \"Edit | Delete\" links showed\r\n     *\r\n     * @param $item - row (key, value array)\r\n     * @return HTML\r\n     *\/\r\n\r\n   function first_column_name($item) {\r\n   $actions = array(\r\n\r\n            'edit'      =&gt; sprintf('&lt;a href=\"?page=custom_detail_page&amp;user=%s\"&gt;Edit&lt;\/a&gt;',$item['id']),\r\n\r\n            'trash'    =&gt; sprintf('&lt;a href=\"?page=custom_list_page&amp;action=trash&amp;user=%s\"&gt;Trash&lt;\/a&gt;',$item['id']),\r\n\r\n            );\r\n\r\n  return sprintf('%1$s %2$s', $item['first_column_name'], $this-&gt;row_actions($actions) );\r\n\r\n}<\/pre>\n<div class=\"alert alert-info\">Setup Bulk Actions and Process Bulk Action for Columns<\/div>\n<pre class=\"brush:php\"> function get_bulk_actions()\r\n      {\r\n\r\n        $actions = array(\r\n\r\n            'trash'    =&gt; 'Move To Trash' \r\n        );\r\n\r\n        return $actions;\r\n    }\r\npublic function process_bulk_action()\r\n\r\n        {  \r\n              global $wpdb;\r\n        if ('trash' === $this-&gt;current_action()) {\r\n\r\n              if (isset($_GET['user'])) {\r\n\r\n                  if (is_array($_GET['user'])){\r\n\r\n            foreach ($_GET['user'] as $id) {\r\n\r\n            if(!empty($id)) { \r\n\r\n              wp_trash_post($id);\r\n\r\n              $table_name = $wpdb-&gt;prefix . 'table_name';\r\n            \r\n              $wpdb-&gt;query(\"update $table_name set post_status='trash' WHERE id IN($id)\");  \r\n\r\n              }\r\n\r\n\r\n            }\r\n\r\n            }\r\n\r\n            else{\r\n\r\n                  if (!empty($_GET['user'])) { \r\n                      \r\n                      $id=$_GET['user'];\r\n\r\n                      wp_trash_post($id);  \r\n\r\n                      $table_name = $wpdb-&gt;prefix . 'table_name';\r\n                    \r\n                      $wpdb-&gt;query(\"update $table_name set post_status='trash' WHERE id =$id\");  \r\n\r\n                      }\r\n\r\n              }\r\n          }\r\n\r\n      }\r\n\r\n    }\r\n\r\n<\/pre>\n<div class=\"alert alert-info\">Get Data From Database<\/div>\n<pre class=\"brush:php\">private function table_data()\r\n   {      \r\n      global $wpdb;\r\n\r\n       $table_name = $wpdb-&gt;prefix . 'table_name';\r\n\r\n       $data=array();\r\n\r\n        if(isset($_GET['s']))\r\n          {\r\n          \r\n          $search=$_GET['s'];\r\n\r\n          $search = trim($search);\r\n\r\n          $wk_post = $wpdb-&gt;get_results(\"SELECT column_name_one,column_name_two FROM $table_name WHERE column_name_three LIKE '%$search%' and column_name_four='value'\");\r\n\r\n          }\r\n\r\n        else{\r\n            $wk_post=$wpdb-&gt;get_results(\"SELECT column_name_one,column_name_two FROM $table_name WHERE column_name_three='value'\");\r\n        }\r\n\r\n        $field_name_one = array();\r\n\r\n        $field_name_two = array();\r\n\r\n        $i=0;\r\n\r\n        foreach ($wk_post as $wk_posts) {\r\n\r\n            $field_name_one[]=$wk_posts-&gt;field_name_one;\r\n\r\n            $field_name_two[]=$wk_posts-&gt;field_name_two;\r\n\r\n            $data[] = array(\r\n\r\n                    'first_column_name'  =&gt; $field_name_one[$i],\r\n\r\n                    'second_column_name' =&gt;   $field_name_two[$i]   \r\n \r\n                    );\r\n\r\n            $i++;\r\n\r\n        }\r\n\r\n        return $data;\r\n\r\n    }<\/pre>\n<div class=\"alert alert-info\">Setup The Prepared Data and SORT\u00a0using usort method<\/div>\n<pre class=\"brush:php\">public function prepare_items()  \r\n     {\r\n\r\n        global $wpdb;  \r\n\r\n            $columns = $this-&gt;get_columns();\r\n\r\n            $sortable = $this-&gt;get_sortable_columns();\r\n\r\n            $hidden=$this-&gt;get_hidden_columns();\r\n\r\n            $this-&gt;process_bulk_action();\r\n\r\n            $data = $this-&gt;table_data();\r\n            \r\n            $totalitems = count($data);\r\n\r\n            $user = get_current_user_id();\r\n\r\n            $screen = get_current_screen();\r\n\r\n            $option = $screen-&gt;get_option('per_page', 'option'); \r\n\r\n            $perpage = get_user_meta($user, $option, true);\r\n\r\n            $this-&gt;_column_headers = array($columns,$hidden,$sortable); \r\n\r\n            if ( empty ( $per_page) || $per_page &lt; 1 ) {\r\n            \r\n              $per_page = $screen-&gt;get_option( 'per_page', 'default' ); \r\n\r\n            }\r\n\r\n\r\n            function usort_reorder($a,$b){\r\n\r\n            $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'column_name_one'; \/\/If no sort, default to title\r\n\r\n            $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'desc'; \/\/If no order, default to asc\r\n\r\n            $result = strcmp($a[$orderby], $b[$orderby]); \/\/Determine sort order\r\n\r\n            return ($order==='asc') ? $result : -$result; \/\/Send final sort direction to usort\r\n\r\n        }\r\n\r\n        usort($data, 'usort_reorder');\r\n\r\n                $totalpages = ceil($totalitems\/$perpage); \r\n\r\n                $currentPage = $this-&gt;get_pagenum();\r\n                \r\n                $data = array_slice($data,(($currentPage-1)*$perpage),$perpage);\r\n\r\n                $this-&gt;set_pagination_args( array(\r\n\r\n                \"total_items\" =&gt; $totalitems,\r\n\r\n                \"total_pages\" =&gt; $totalpages,\r\n\r\n                \"per_page\" =&gt; $perpage,\r\n            ) );\r\n                \r\n        $this-&gt;items =$data;\r\n    }<\/pre>\n<p>You can also find a complete guide over this class here <a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/WP_List_Table\" target=\"_blank\" rel=\"nofollow noopener\">WordPress Codex<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Create Admin tables using WP_List_Table CLASS &#8211; In WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at wordpress backend. In the WordPress <a href=\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":67,"featured_media":46190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1260],"tags":[2989,2988],"class_list":["post-46130","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-wordpress-admin-tables","tag-wp_list_table-class"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create Admin tables using WP_List_Table CLASS<\/title>\n<meta name=\"description\" content=\"WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at WordPress back-end.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create Admin tables using WP_List_Table CLASS\" \/>\n<meta property=\"og:description\" content=\"WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at WordPress back-end.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-18T07:12:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-07-14T09:38:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Webkul\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Webkul\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\"},\"author\":{\"name\":\"Webkul\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02\"},\"headline\":\"Create Admin tables using WP_List_Table CLASS\",\"datePublished\":\"2016-04-18T07:12:47+00:00\",\"dateModified\":\"2018-07-14T09:38:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\"},\"wordCount\":468,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png\",\"keywords\":[\"wordpress admin tables\",\"wp_list_table class\"],\"articleSection\":[\"WordPress\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\",\"url\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\",\"name\":\"Create Admin tables using WP_List_Table CLASS\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png\",\"datePublished\":\"2016-04-18T07:12:47+00:00\",\"dateModified\":\"2018-07-14T09:38:23+00:00\",\"description\":\"WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at WordPress back-end.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png\",\"width\":825,\"height\":260,\"caption\":\"Create Custom Role WordPress\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create Admin tables using WP_List_Table CLASS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02\",\"name\":\"Webkul\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Webkul\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/amit098\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create Admin tables using WP_List_Table CLASS","description":"WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at WordPress back-end.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/","og_locale":"en_US","og_type":"article","og_title":"Create Admin tables using WP_List_Table CLASS","og_description":"WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at WordPress back-end.","og_url":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-04-18T07:12:47+00:00","article_modified_time":"2018-07-14T09:38:23+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png","type":"image\/png"}],"author":"Webkul","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Webkul","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/"},"author":{"name":"Webkul","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02"},"headline":"Create Admin tables using WP_List_Table CLASS","datePublished":"2016-04-18T07:12:47+00:00","dateModified":"2018-07-14T09:38:23+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/"},"wordCount":468,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png","keywords":["wordpress admin tables","wp_list_table class"],"articleSection":["WordPress"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/","url":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/","name":"Create Admin tables using WP_List_Table CLASS","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png","datePublished":"2016-04-18T07:12:47+00:00","dateModified":"2018-07-14T09:38:23+00:00","description":"WordPress WP_List_Table Class is used to display data, e.g. users, plugins, comments, or posts. Each post type that has a dashboard uses the WP_List_Table class to display data. We uses WP_List_Table class so that we can display\u00a0 custom post type data at WordPress back-end.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/WordPress-Code-Snippet.png","width":825,"height":260,"caption":"Create Custom Role WordPress"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/create-admin-tables-using-wp_list_table-class\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create Admin tables using WP_List_Table CLASS"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/14f2bcf2d2b044589b35c23a46036b02","name":"Webkul","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b95a9889faa1ac8c620c762d0101c3a62e439d100e083ee7257caad54fa5305a?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Webkul"},"url":"https:\/\/webkul.com\/blog\/author\/amit098\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/46130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/67"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=46130"}],"version-history":[{"count":39,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/46130\/revisions"}],"predecessor-version":[{"id":133541,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/46130\/revisions\/133541"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/46190"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=46130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=46130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=46130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}