Replacing the List table of a Post Type

No, you cannot replace the list table. There is no filter, everything is hard-coded. But you can change the post type registration, set show_ui to FALSE to prevent the built-in page, and add a custom page for the post type listing to show the editable items. add_action( ‘wp_loaded’, function(){ register_post_type( ‘test’, array( ‘labels’ => array( … Read more

WP_list_table bulk_action get edit and delete

So, I found the problem. First of all, I was not selecting the right ID’s on my checkbox or buttons, so I changed to code to do so: function column_name($item){ $item_json = json_decode(json_encode($item), true); $actions = array( ‘edit’ => sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/265648/?page=%s&action=%s&id=%s”>Edit</a>’, $_REQUEST[‘page’], ‘edit’, $item_json[‘id’]), ‘delete’ => sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/265648/?page=%s&action=%s&id=%s”>Delete</a>’, $_REQUEST[‘page’], ‘delete’, $item_json[‘id’]), ); return ‘<em>’ . … Read more

Create a clickable name in WP_List_Table for Plugin Admin

The WP_List_Table class ultimately uses the single_row_columns method to output each table cell. If we look at that method, we’ll see this part: … elseif ( method_exists( $this, ‘column_’ . $column_name ) ) { echo “<td $attributes>”; echo call_user_func( array( &$this, ‘column_’ . $column_name ), $item ); echo “</td>”; } … Add a method to … Read more

List Table API – Safe to use?

Its not a private class, only its methods (some) are defined as private so as long as you extend the class and use your own instance of theme extention you should bs safe and fine.

Custom WP_List_Table displays blank rows

You’re getting the blank rows because your column headers are registered late. And you should register the headers (i.e. initialize the list table class instance) before admin notices are rendered on the page, i.e. before WordPress fires hooks like admin_notices. But your customer_list_page() function, which I believe, is a callback for either add_menu_page() or add_submenu_page(), … Read more

Add custom column at custom posts list

Adding A New Column To The books Post Table Here we can use the filters manage_{$post->post_type}_posts_custom_column manage_{$post->post_type}_posts_columns or for the books post type: manage_books_posts_custom_column manage_books_posts_columns Here’s an example how we could display a button, for each row in the send_email column: /** * Books Post Table: Display a utton in each row in the ‘send_email’ … Read more