In the functions.php of my Child Theme I have the following lines:
//Elementor - disable Google Fonts
add_filter( 'elementor/frontend/print_google_fonts', '__return_false' );
add_filter( 'elementor/fonts/additional_fonts', '__return_false' );
I've found this solution on various posts on the Internet.
- https://github.com/elementor/elementor/issues/4624
- https://www.moorewebexposure.com/wordpress-posts/elementor/disable-all-google-fonts-from-loading-in-elementor/
Now the thing is: This works only on php7.
On PHP 8 it breaks my site.
Why is this and what can I do to resolve this?
Thanks in advance.
edit: The error is thrown: /root/wp-content/plugins/elementor-pro/modules/assets-manager/asset-types/fonts-manager.php on line 342 and the according snippet is:
return array_replace( $custom_fonts, $fonts );
in the block:
public function register_fonts_in_control( $fonts ) {
$custom_fonts = $this->get_font_types();
if ( empty( $custom_fonts ) ) {
$this->generate_fonts_list();
$custom_fonts = $this->get_font_types();
}
return array_replace( $custom_fonts, $fonts );
}
