• Hello. Theme looks nice but on the latest WP (5.9.3) it breaks the Dashboard right after activation. When using the live preview, the following is shown:

    Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /home/.../wp-includes/script-loader.php:2366

    That line is part of the following function:

    function wp_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() &&
    		get_current_screen()->is_block_editor()      <--- line 2366
    	) {
    		return;
    	}
    
    	$filters = wp_get_global_styles_svg_filters();
    	if ( ! empty( $filters ) ) {
    		echo $filters;
    	}
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author asphaltthemes

    (@asphaltthemes)

    Hi @blaqqcat,

    Thank you for notifying. Will check and fix this soon.

    Regards

    Theme Author asphaltthemes

    (@asphaltthemes)

    Hi @blaqqcat,

    Fixed the issue ??

    Thanks

    memmorg

    (@memmorg)

    Hello. After updating the theme, I still get a similar error, saying:

    Fatal error: Uncaught Error: Call to undefined function get_current_screen() in /afs/elte.hu/user/b/berkri/web/wordpress/wp-includes/script-loader.php:2465

    I checked the code, and it is:

    if(
         is_admin() &&
         ! get_current_screen()->is_block_editor()
       ) {
         return;
         }

    Any ideas? Thanks in advance!

    • This reply was modified 2 years ago by memmorg.
    Theme Author asphaltthemes

    (@asphaltthemes)

    @memmorg Will check it out & push an update today(hopefully)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Call to undefined function’ is closed to new replies.