Issue with get_current_screen() ?
-
I’m getting critical errors on some sites and Modula seems to be the single point of refererence in each case. I’ve pasted the error below – chatgpt seems to think that it’s to do with calling get_current_screen() on front end and suggests this:
// In class-modula.php around line 389
if (is_admin()) {
$screen = get_current_screen();
// Ensure $screen is available before using it
if ($screen) {
// Your existing code that uses $screen
}
}FYI – 2 plugins that I had conflict with, Beaver Builder in edit mode… And SEO Press
[Tue Jul 30 12:37:22.747867 2024] [proxy_fcgi:error] [pid 2511180:tid 2511281] [client 172.70.85.189:0] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/simplyhen/webapps/app-simplyhen2022/wp-content/plugins/modula-best-grid-gallery/includes/class-modula.php:389\nStack trace:\n#0 /home/simplyhen/webapps/app-simplyhen2022/wp-includes/class-wp-hook.php(324): Modula->modula_enqueue_media()\n#1 /home/simplyhen/webapps/app-simplyhen2022/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#2 /home/simplyhen/webapps/app-simplyhen2022/wp-includes/plugin.php(517): WP_Hook->do_action()\n#3 /home/simplyhen/webapps/app-simplyhen2022/wp-includes/media.php(4960): do_action()\n#4 /home/simplyhen/webapps/app-simplyhen2022/wp-content/plugins/wp-seopress/src/Actions/Admin/ModuleMetabox.php(69): wp_enqueue_media()\n#5 /home/simplyhen/webapps/app-simplyhen2022/wp-content/plugins/wp-seopress/src/Actions/Admin/ModuleMetabox.php(170): SEOPress\Actions\Admin\ModuleMetabox->enqueueModule()\n#6 /home/simplyhen/webapps/app-simplyhen2022/wp-includes/class-wp-hook.php(324…’, referer: https://simplyhen.co.uk/wp-admin/post.php?post=1148&action=edit&classic-editor
- You must be logged in to reply to this topic.