Call to undefined function get_current_screen() in render-svg-filters.php:23
-
Hey,
I’m running WordPress 5.9.2, and I get this error:
An error of type E_ERROR was caused in line 23 of the file /var/www/wordpress/wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/render-svg-filters.php. Error message: Uncaught Error: Call to undefined function get_current_screen() in /var/www/wordpress/wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/render-svg-filters.php:23 Stack trace: #0 /var/www/wordpress/wp-includes/class-wp-hook.php(307): gutenberg_global_styles_render_svg_filters() #1 /var/www/wordpress/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters() #2 /var/www/wordpress/wp-includes/plugin.php(474): WP_Hook->do_action() #3 /var/www/wordpress/wp-includes/general-template.php(3074): do_action() #4 /var/www/wordpress/wp-content/themes/simplemag-child/header.php(20): wp_body_open() #5 /var/www/wordpress/wp-includes/template.php(770): require_once('/var/www/wordpr...') #6 /var/www/wordpress/wp-includes/template.php(716): load_template() #7 /var/www/wordpress/wp-includes/general-template.php(48): locate_template() #8 /var/www/wordpress/wp-content/themes/simplemag-child/404.php(8): get_header() #9 /var/www/wordpress/wp-includes/template.php(772): require('/var/www/wordpr...')
As a temporary fix, I’ve added this line in wp-content/plugins/gutenberg/lib/compat/wordpress-5.9/render-svg-filters.php function gutenberg_global_styles_render_svg_filters():
if ... function_exists( 'get_current_screen' ) &&
Making it:
function gutenberg_global_styles_render_svg_filters() { /* * When calling via the in_admin_header action, we only want to render the * SVGs on block editor pages. */ if ( is_admin() && function_exists( 'get_current_screen' ) && /* Temporary fix */ ! get_current_screen()->is_block_editor() ) { return; }
`
I don’t know if this is a good fix, if so it should be integrated to the code, otherwise, I’d like to hear about a better one…
Thank you.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Call to undefined function get_current_screen() in render-svg-filters.php:23’ is closed to new replies.