Error: Call to undefined function get_current_screen() with Dokan
-
I get the following error message, after i created an vendor account
https://staging16.evooming.de/?page=dokan-seller-setup (Does not work in this way, you have to pay first 😉 )Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/customer/www/staging16.evooming.de/public_html/wp-content/plugins/sg-cachepress/core/Admin/Admin.php:383 Stack trace: #0 /home/customer/www/staging16.evooming.de/public_html/wp-content/plugins/sg-cachepress/core/Admin/Admin.php(284): SiteGround_Optimizer\Admin\Admin->is_plugin_page() #1 /home/customer/www/staging16.evooming.de/public_html/wp-includes/class-wp-hook.php(303): SiteGround_Optimizer\Admin\Admin->admin_print_styles('') #2 /home/customer/www/staging16.evooming.de/public_html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #3 /home/customer/www/staging16.evooming.de/public_html/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #4 /home/customer/www/staging16.evooming.de/public_html/wp-content/plugins/dokan-lite/includes/Vendor/SetupWizard.php(121): do_action('admin_print_sty...') #5 /home/customer/www/staging16.evooming.de/public_html/wp-content/plugins/dokan-lite/includes/Vendor/SetupWizard.php(102) in /home/customer/www/staging16.evooming.de/public_html/wp-content/plugins/sg-cachepress/core/Admin/Admin.php on line 383
Can check, if there is this function, before you use it?
Something like:/** * Check if this is the SG Cachepress page. * * @since @version * * @return bool True/False */ public function is_plugin_page() { if( !function_exists('get_current_screen') ) { return false; } $current_screen = \get_current_screen(); if ( in_array( $current_screen->id, $this->get_plugin_page_ids() ) ) { return true; } return false; }
Thank you very much
Best Regards,
Klaus
- The topic ‘Error: Call to undefined function get_current_screen() with Dokan’ is closed to new replies.