How to remove the bottom table headers (column names) in WP_List_Table?

You can override the WP_List_Table::display() method and remove the tfoot which contains the bottom table headers: <tfoot> <tr> <?php $this->print_column_headers( false ); ?> </tr> </tfoot> Or you can add a specific class to the relevant admin page and use CSS to visually hide the bottom table headers: .my-plugin-foo-page table.wp-list-table > tfoot { display: none; }

Index of row in WP_List_Table

That should be possible, but it looks pretty complicated. As you have undoubtedly seen, the display_rows method just passes a single line and there’s no counter. This means that the row number must be in the $item variable for you to extract it. Since it is not there natively, you must insert it before you … Read more

How to Define Multiple List Tables in a Single Submenu

You don’t. WP_List_Table and the following features were all built on the assumption of there only being a single table on the page: choosing columns via screen options pagination column sorting search/filtering bulk actions At best, you could use the code from the official developer docs to print a second table, but then you’ll run … Read more

sortable columns for multiple custom post types not working

I thought if I used manage_edit-post_sortable_columns I could target the ones I have conditionally checked for? That hook runs only on the “Posts” page (at wp-admin/edit.php) for managing posts in the default/core post post type. I.e. When the post_type parameter in the (current page) URL is not set or empty, or that it’s set to … Read more

Possible to add a statement to a core file?

There is zero reason to do this. Why would you need your include in edit.php? Just include it in your plugin. If for some reason you need to hook into the edit.php page (hard to tell what you’re doing), you can use, add_action( ‘load-edit.php’, ‘your_function’ );

Add and Remove Row Actions in an Existing WP_List_Table

As for the user rows in the Users list table (at wp-admin/users.php), you would use the user_row_actions hook like so: add_filter( ‘user_row_actions’, ‘my_user_row_actions’, 10, 2 ); function my_user_row_actions( $actions, $user_object ) { // Remove the Edit action. unset( $actions[‘edit’] ); // Add your custom action. $actions[‘my_action’] = ‘<a href=”<action URL>”>Action</a>’; return $actions; } The other … Read more

Retrieve only posts from a specific user in wp-admin/edit.php

You will need to filter that list. function alter_views_wpse_103613($views) { $role=”blogger_simple”; if (current_user_can($role)) { $views = array(‘mine’=>$views[‘mine’]); } return $views; } add_filter( ‘views_edit-post’, ‘alter_views_wpse_103613’ ); That filter list is part of the WP_List_Table class if you want to investigate more. Look for the views method.