Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table

$this->items = $this->get_table_data(); If this line is triggering the error, then the reason is probably that items should be an array of arrays, not an array of stdClass objects. But you don’t need to change much, as get_results() does support returning arrays instead of objects (which is the default). Instead of $get_bl_list = $wpdb->get_results(“SELECT * … Read more

Admin Post List table Query filtering “WHERE” for custom post type

Awesome. This works! Thanks @Milo /*Change results based on the current user’s role and status */ function posts_for_current_role($query) { global $pagenow; if( ‘edit.php’ != $pagenow || !$query->is_admin ) return $query; if( current_user_can(‘editor’)): //Add query where clause to status equals “working”. $query->set( ‘post_status’, array( ‘working’, ‘draft’ ) ); endif; if( current_user_can(‘administrator’)): $query->set( ‘post_status’, array( ‘published’) ); … Read more

Best Way To Locate Offending WP Table

It’s unusual to include/require files based on database values, but if that’s what’s happening — one way to track it down would be to export the DB from production to an SQL file (which maybe you already have), then search through it with a text editor. You should then be able to look at the … Read more