Add content before/after admin post wp-list-table

This has probably been solved many times here on this site, but maybe not with all your requirements? So let me try to answer it here: You can try to use the all_admin_notices and in_admin_footer actions, wrapped inside the load-edit.php action to target the edit.php page: add_action( ‘load-edit.php’, function(){ $screen = get_current_screen(); // Only edit … Read more

How to implement WP_List_Table? WP_List_Table giving array instead of a value in listing table

Look at this code public function column_default( $item, $column_name ) { switch ( $column_name ) { case ‘address’: case ‘city’: return $item[ $column_name ]; default: return print_r( $item, true ); //Show the whole array for…. } } Since you are only trying to render user_id , browser and ip_address and those are not available in … Read more

wp_list_table search box does not show

You must use $list_obj->prepare_items() before $list_obj->search_box(‘Search’, ‘search’) function! Example: <form method=”post”> <input type=”hidden” name=”page” value=”<?php echo $_REQUEST[‘page’]; ?>” /> <?php $this->sales_obj->prepare_items(); $this->sales_obj->search_box(‘Search’, ‘search’); $this->sales_obj->display(); ?> </form>

Replace Dashes Before Title in Page List

You can’t change dashes using any filter because there is no filter available to change it. but still you can change this using jQuery put this code inside functions.php add_action(‘admin_head’,function(){ global $pagenow; // check current page. if( $pagenow == ‘edit.php’ ){ ?> <script> jQuery(function($){ var post_title = $(‘.wp-list-table’).find(‘a.row-title’); $.each(post_title,function(index,em){ var text = $(em).html(); // Replace … Read more

How to Remove Certain Screen Options and Table Columns from post type in wp_list_table?

What you need is to modify the $columns variable that is used during list display which you can modify using the ‘manage_posts_columns’ and ‘manage_pages_columns’ hooks for post_type=”post” and post_type=”page”, respectively. If you want to ignore custom post types you can inspect the 2nd parameter passed to ‘manage_posts_columns’ as I did in my example to show … Read more

List table not rendering when $this->items is filled

I did same error first time I implemented WP_List_Table. The problem is that when you call WP_List_Table::display() WordPress in turn calls: WP_List_Table::display_rows_or_placeholder() WP_List_Table::display_rows() WP_List_Table::single_row() WP_List_Table::single_row_columns() Last function is called for every row. If you look at its code (see source), it has: if ( ‘cb’ == $column_name ) { // you don’t have ‘cb’ column, … Read more

How to remove _wp_http_referer from URL when using WP_List_table?

As the last commenter on that Q suggested, you should probably check for actions, remove the query args and redirect. Something like: $doaction = $wp_list_table->current_action(); if ( $doaction && isset( $_REQUEST[‘SOMEVAR’] ) ) { // do stuff } elseif ( ! empty( $_GET[‘_wp_http_referer’] ) ) { wp_redirect( remove_query_arg( array( ‘_wp_http_referer’, ‘_wpnonce’ ), stripslashes( $_SERVER[‘REQUEST_URI’] ) … Read more