fatal error when using wp_list_table in wordpress

I’m in fighting with a fatal error when using wp_list_table in a class , in totally i extend the wordpress wp_list_table in a class and then include it into my plugin when i try to instance an object from it , and call the .display() function it says:

Fatal error: Call to undefined function get_current_screen() in
/Applications/MAMP/htdocs/wordpress_33/wp-admin/includes/class-wp-list-table.php
on line 87

Read More

any suggestion please?

Related posts

Leave a Reply

2 comments

  1. I found I had to explicitly include the ‘wp-admin/includes/screen.php’ script

    <?php
    
    if(!class_exists('WP_List_Table')){
        require_once( ABSPATH . 'wp-admin/includes/screen.php' );
        require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
    }
    
    /**
     * Handle the admin tasks for the BHAA companies
     * @author assure
     *
     */
    class MyTable extends WP_List_Table