What a nightmare, an old WordPress site just stopped working with a Fatal Error and the cause was NavMenu, which references no-longer-existing Elementor schemes, namely:
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
After a long talk with ChatGPT we finally ‘fixed’ this by removing all the scheme references in two files:
/modules/menus/widgets/default-navmenu.php
/modules/menus/widgets/navmenu-overlay.php
So for example, this code:
$this->add_control(
'nav_bar_bg',
[
'label' => __( 'Navbar Background', 'navmenu-addon-for-elementor' ),
'type' => Controls_Manager::COLOR,
'scheme' => [
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_1,
],
'default' => '#00215e',
'selectors' => [
'{{WRAPPER}} .elementor-menu' => 'background-color: {{VALUE}};',
],
]
);
Becomes:
$this->add_control(
'nav_bar_bg',
[
'label' => __( 'Navbar Background', 'navmenu-addon-for-elementor' ),
'type' => Controls_Manager::COLOR,
//'scheme' => [
// 'type' => Scheme_Color::get_type(),
// 'value' => Scheme_Color::COLOR_1,
//],
'default' => '#00215e',
'selectors' => [
'{{WRAPPER}} .elementor-menu' => 'background-color: {{VALUE}};',
],
]
);
Note the // on the scheme block. There are quite a lot of occurrences of this in the two files.
Note also some single lines that need the same treatment:
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'search_typography',
'label' => __( 'Typography', 'navmenu-addon-for-elementor' ),
//'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .overlay-navigation a',
]
);
I’m not saying this is a true fix, but it does at least get things working again.
It looks like NavMenu stopped being updated several years ago.
Comments