How to Define Multiple List Tables in a Single Submenu

You don’t. WP_List_Table and the following features were all built on the assumption of there only being a single table on the page: choosing columns via screen options pagination column sorting search/filtering bulk actions At best, you could use the code from the official developer docs to print a second table, but then you’ll run … Read more

sortable columns for multiple custom post types not working

I thought if I used manage_edit-post_sortable_columns I could target the ones I have conditionally checked for? That hook runs only on the “Posts” page (at wp-admin/edit.php) for managing posts in the default/core post post type. I.e. When the post_type parameter in the (current page) URL is not set or empty, or that it’s set to … Read more

Possible to add a statement to a core file?

There is zero reason to do this. Why would you need your include in edit.php? Just include it in your plugin. If for some reason you need to hook into the edit.php page (hard to tell what you’re doing), you can use, add_action( ‘load-edit.php’, ‘your_function’ );

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 my_user_row_actions( $actions, $user_object ) { // Remove the Edit action. unset( $actions[‘edit’] ); // Add your custom action. $actions[‘my_action’] = ‘<a href=”<action URL>”>Action</a>’; return $actions; } The other … Read more

Retrieve only posts from a specific user in wp-admin/edit.php

You will need to filter that list. function alter_views_wpse_103613($views) { $role=”blogger_simple”; if (current_user_can($role)) { $views = array(‘mine’=>$views[‘mine’]); } return $views; } add_filter( ‘views_edit-post’, ‘alter_views_wpse_103613’ ); That filter list is part of the WP_List_Table class if you want to investigate more. Look for the views method.

How to sort posts in a custom post type by title in ascending order by default?

You should use pre_get_posts: add_action(‘pre_get_posts’,’wpse56753_businesses_default_order’); function wpse56753_businesses_default_order( $query ){ if( ‘business’ == $query->get(‘post_type’) ){ if( $query->get(‘orderby’) == ” ) $query->set(‘orderby’,’title’); if( $query->get(‘order’) == ” ) $query->set(‘order’,’ASC’); } }