Fatal error on niteo-cmp.php
-
Hi there,
I found a website affected by the following error:
Fatal error: Call to undefined function get_current_screen() in wp-content/plugins/cmp-coming-soon-maintenance/niteo-cmp.php on line 584.
The error is triggered on a frontend page that receives a POST request.
It seems to me that the code from cmp_admin_bar() should only be executed on admin pages or more specifically, only if ‘get_current_screen()’ is defined at that point (the documentation says the function won’t be defined on wp-admin/customize.php).
As a workaround I added the following at the top of the cmp_admin_bar() function.
if ( ! function_exists( ‘get_current_screen’ ) ) {
return;
}Please let me know if there is a more appropriate way to avoid this problem.
- The topic ‘Fatal error on niteo-cmp.php’ is closed to new replies.