Wp_List_Table is showing as no class found named wp list table

I Developed a plugin I wanted to show data in wordpress table in admn area for which Wp_List_Table clas is used to do that I tried to use this but the problem is that it not being able to properly implement something is wrong I do not know what this is wrong which is causing this error so now let me define what exactly is the problem First let me post the code of my plugin along with file path

plugin-directory/inc/admin/Admin.php

namespace Incadmin;

class Admin {
        public static function get_vendors() {
        require_once PLUGIN_PATH . 'inc/admin/MV_Vendors.php';

        $tableData = new MV_Vendors();

        $tableData->prepare_items();

        return $tableData->display();
    }

    public function admin_page_mv_vendors() {
        $vendors = self::get_vendors();
        
        require_once( PLUGIN_PATH . 'inc/admin/pages/template-all-vendors.php');
    }
}

plugin-directory/inc/admin/MV_Vendors.php

namespace Incadmin; 

require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';

class MV_Vendors extends WP_List_Table {
     //code will go here
}

So now here is what error I am getting is given below

Uncaught Error: Class ‘IncadminWP_List_Table’ not found in /home/codebkpa/public_html/venuebooking/wp-content/plugins/multi-vendor/inc/admin/MV_Vendors.php:10 Stack trace: #0

please can anyone help me out why i am getting hthis unusual error

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

You’ve specified a namespace, so PHP is looking for that class in the namespace Incadmin

You can tell it to use the root namespace where that class is probably defined with a leading like:

class MV_Vendors extends WP_List_Table {


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x