WP_List_Table Inside Metabox Not Working on Submit
You just need to override the function display_tablenav() with a blank function in you parent class. It is explained here.
You just need to override the function display_tablenav() with a blank function in you parent class. It is explained here.
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
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
Sorting by size Adding custom column and sorting by post_content length is possible. It won’t be very efficient though, I’m afraid. First you’ll have to add your custom column and display the length of content in there. I’ve assumed that you’re interested in trimmed content (so ‘ ‘ is still empty). Then you’ll have to … Read more
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>
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
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
You could try to “hijack” the following filter in the WP_List_Table class: /** * Filter the list of available list table views. * * The dynamic portion of the hook name, `$this->screen->id`, refers * to the ID of the current screen, usually a string. * * @since 3.5.0 * * @param array $views An array … Read more
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
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