• Resolved klausschwarzkopf

    (@klausschwarzkopf)


    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

Viewing 1 replies (of 1 total)
  • Plugin Author Hristo Pandjarov

    (@hristo-sg)

    SiteGround Representative

    Hey,

    This error is occurring as the Dokan plugin is calling admin-related method and scripts on the front-end. Please, contact their developers for additional assistance on that matter. There is nothing wrong with our plugin and we won’t try to mitigate this problem which shouldn’t be happening in first place.

Viewing 1 replies (of 1 total)
  • The topic ‘Error: Call to undefined function get_current_screen() with Dokan’ is closed to new replies.