Skip to main content
17 votes

How to create Custom filter options in wp_list_table?

Code class Kv_subscribers_list extends WP_List_Table { function __construct(){ global $status, $page; parent::__construct( array( 'singular' => 'notification', ...
bravokeyl's user avatar
  • 3,369
9 votes

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"> <...
axentmedia's user avatar
9 votes
Accepted

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 ...
Sally CJ's user avatar
  • 39.3k
7 votes
Accepted

WP_List_Table default orderby is numeric

Try the strnatcmp() for "natural" ordering, instead of strcmp() (src) or handle the ID ordering specially, e.g. with typecasting and the spaceship operator <=> in PHP 7.
birgire's user avatar
  • 67.4k
7 votes
Accepted

How to Arrange Posts by Size in the WordPress Dashboard?

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 ...
Krzysiek Dróżdż's user avatar
5 votes
Accepted

Removing sorting option for columns on the post lists page

The filter hook manage_edit-post_sortable_columns contains all the columns, which are sortable. So you could hook into this filter and unset the title: <?php add_filter( 'manage_edit-...
websupporter's user avatar
  • 2,979
5 votes

How to create Custom filter options in wp_list_table?

Well, I know this is quite late, but since this is the first result in google when searching for WP_List_Table filtering, I must tell you that there's extra_tablenav function available to be overrode ...
metita's user avatar
  • 51
4 votes

Change order of custom columns for edit panels

This is a combination of a few SO answers, hopefully it helps someone! function array_insert( $array, $index, $insert ) { return array_slice( $array, 0, $index, true ) + $insert + array_slice(...
DigitalDesignDj's user avatar
4 votes
Accepted

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 ]; ...
bravokeyl's user avatar
  • 3,369
3 votes

Replace Dashes Before Title in Page List

As @Toscho says, the title column is hard coded, so you cannot change that. What you can do, however, is remove the column and redefine it as a custom column: add_filter( 'manage_pages_columns', '...
cjbj's user avatar
  • 14.6k
3 votes
Accepted

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',...
GKS's user avatar
  • 1,306
3 votes

Replace Dashes Before Title in Page List

This is hard-coded and cannot be changed without changing the entire list table class: $pad = str_repeat( '&#8212; ', $this->current_level ); echo "<strong>"; $format = ...
fuxia's user avatar
  • 107k
3 votes

WP_list_table add custom row action

Found it, the action needs to be defined in your plugin function: function process_bulk_action() {
bnjroos's user avatar
  • 61
3 votes
Accepted

specific rows style for in custom list table using WP_List_Table

It depends where you want to apply your custom css class. CSS class for table row If you want to add the custom class to the <tr> element, I recommend to overwrite the function single_row like ...
hbit's user avatar
  • 230
3 votes
Accepted

Checkboxes on custom `WP_List_Table` also check select all

I ran into this same problem and did some digging. The jQuery selector to find the checkboxes includes an iedit class on the table <tr> elements. I assume this class is added via JavaScript on ...
Phillip Dodson's user avatar
2 votes

wp_list_tables bulk actions

WP List w/ bulk actions using an "Array" DATA https://wpengineer.com/2426/wp_list_table-a-step-by-step-guide/ (Make it as a plugin) https://gist.github.com/Latz/7f923479a4ed135e35b2 (for functions....
samjco-com's user avatar
2 votes
Accepted

Programatically inserted posts not showing in Posts Table

Well, the problem is quite simple: it's publish, not published. According to the documentation: post_status (string / array) - use post status. Retrieves posts by Post Status. Default value is '...
noquierouser's user avatar
2 votes
Accepted

Can I simplify in function column_default use of queries

Your problem is mostly just a change in PHP logic, not really WordPress. Anyway, we are here to help, and that would be off-topic on other sites too, so … It is unfortunate enough that you have to ...
fuxia's user avatar
  • 107k
2 votes

Best Alternative to WP List Table

I've not found any best alternative to this class. The WP_List_table is best to use. But the way to use it, is the concern. If you read the Codex cafefully you'll see a warning that- This class's ...
CodeMascot's user avatar
  • 4,527
2 votes
Accepted

WP_List_Table bulk actions notice & warning

with add_query_arg the first paramater is required and it must be an array when it is alone : add_query_arg([]) more informations here : http://developer.wordpress.org/reference/functions/...
mmm's user avatar
  • 3,704
2 votes

URL Redirect and Bulk Actions in wp_list_table

Understand hierarchy, You don't need to redirect as form are posting values on same page. function process_bulk_action() { // Some security check code here // Get the bulk action $...
sorabh86's user avatar
  • 121
2 votes

Add search Value to wp_list_table pagination

I solved my issue by passing the page variable as a hidden field: <form method="get"> <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" /> <?php ...
keithp's user avatar
  • 141
2 votes
Accepted

How to display additional info in the plugins admin table?

The table of plugins on the plugins admin screen uses WP_Plugins_List_Table which extends the WP_List_Table class. And there are hooks which you can use to modify the table columns, content, etc. Here ...
Sally CJ's user avatar
  • 39.3k
2 votes
Accepted

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 ...
Sally CJ's user avatar
  • 39.3k
2 votes

WP_List_table with form of method=GET redirects to wrong url after submit

Adding following code right inside <table> tag helped me: <input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" /> So what's in the ...
Max's user avatar
  • 21
1 vote
Accepted

Add search bar to Custom Database Table in Wordpress Dashboard

Just add it in where you're doing your custom query called by prepare items: public static function get_members( $per_page = 5, $page_number = 1 ) { global $wpdb; $sql = 'SELECT * FROM ...
sMyles's user avatar
  • 2,846
1 vote

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(...
CompactCode's user avatar
1 vote
Accepted

Add acf field in title (admin table)

Use this to filter the title: add_action( 'admin_head-edit.php', 'wpse264139_edit_post_change_title_in_list' ); function wpse264139_edit_post_change_title_in_list() { add_filter( '...
Samyer's user avatar
  • 243
1 vote

URL Redirect and Bulk Actions in wp_list_table

You need process you bulk actions in admin_action_{ACTION_NAME} hook. Not in wp_list_table class. Read more here
DARK_DIESEL's user avatar
1 vote

List all users and current week entries

If by "made an entry" you mean "has published at least 1 post", then following will do it (with the proviso given below): $args = array ( 'role' => 'spectator', ) ; $spectators = new ...
Paul 'Sparrow Hawk' Biron's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible