How do I get WordPress to refresh my wp_list_table after bulk_delete
All that I had to do was to move the $this->process_bulk_action(); line of code to the beginning of the prepare_items() function.
All that I had to do was to move the $this->process_bulk_action(); line of code to the beginning of the prepare_items() function.
Wrap your ->display() into a form tag, something like below; <form id=”list-table-form” method=”post”> <?php $exampleListTable->display(); ?> </form> It won’t work without form tag.
WP_List_Table can’t create filter link
How to sort posts without featured images in the WordPress Dashboard? thanks
This is happening because of this CSS rule that is generated in load-styles.php: .widefat thead th:last-of-type { -moz-border-radius-topright: 3px; -khtml-border-top-right-radius: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; } I’m not sure why this is here. To remove it, you should make a custom admin theme plugin to overwrite that CSS rule. First create a folder in your … Read more
I came up with this…I changed input fields to <input type=”checkbox” id=”%2$s” name=”post[%2$s][]” value=”%2$s” /> <input type=”checkbox” id=”image_%3$s” name=”post[%3$s][]” value=”%2$s” />’ …and added third parameter to column_image function ($item[‘ID’]) function column_image($item){ return sprintf( ‘<input type=”checkbox” id=”image_%3$s” name=”post[%3$s][]” value=”%2$s” />’, /*$1%s*/ $this->_args[‘singular’], /*$2%s*/ ‘yes’, /*$3%s*/ $item[‘ID’] ); } and with that I get array which use … Read more
Well, the short answer is that your taxonomies and custom post types share slugs, which is what is causing the list table to display nothing. If you were to change the taxonomy slugs from $newType to $newType . ‘_tax’ it should work. I actually used that same slug formula in the rewrites example below. If … Read more
I am assuming the \ are not part of your code, but if they are then those need to be removed. You also are trying to use $user_id without ever declaring it. Here is how I would write the function: function cgc_ub_action_links( $actions, $user_object ) { $url = add_query_arg( array( ‘page_id’ => 13, ‘um_user’ => … Read more
Regarding the “Add new” part, here’s an example that I assume will help you. I haven’t used WP_List_Table so unfortunately I can’t comment much on that. But based on the class reference I’d guess you’d need to use the get_columns() method. Using the code below you should be able to generate an url that you … Read more
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; }