WPIntell

Source evidence

Fix for broken customizer

Navception · support · 2021-02-16T03:41:00+00:00

complaintsentiment
highseverity
0.97relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

7 / 29 rows with source links

24.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

22 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
acmdesigns unresolved
This plugin is no longer maintained or available for download, but I still think it’s a useful plugin and a fairly small one that did its job well until the WordPress theme customizer broke in 2015. The plugin throws the following exception: [28-Dec-2018 18:54:20 UTC] PHP Fatal error: Uncaught Exception: Illegal widget setting ID: nav_menu_item[559-navception1] in ./wp-includes/customize/class-wp-customize-nav-menu-item-setting.php:171 Stack trace: #0 ./wp-includes/class-wp-customize-nav-menus.php(692): WP_Customize_Nav_Menu_Item_Setting->__construct(Object(WP_Customize_Manager), ‘nav_menu_item[5…’, Array) #1 ./wp-includes/class-wp-hook.php(286): WP_Customize_Nav_Menus->customize_register(Object(WP_Customize_Manager)) #2 ./wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #3 ./wp-includes/plugin.php(453): WP_Hook->do_action(Array) #4 ./wp-includes/class-wp-customize-manager.php(926): do_action(‘customize_regis…’, Object(WP_Customize_Manager)) #5 ./wp-includes/class-wp-hook.php(286): WP_Customize_Manager->wp_loaded(”) #6 ./wp-includes/class-wp-hook.php(310): WP_Hook-> in ./wp-includes/customize/class-wp-customize-nav-menu-item-setting.php on line 171 After digging through the code a bit, here’s what I found: On June 16, 2015, WordPress introduced regex checking of menu item IDs. The regex is looking for ‘/^nav_menu_item\[(?P<id>-?\d+)\]$/’ which breaks Navception because Navception adds a ‘-navception’ suffix to the menu item IDs. WP is looking for an id like “nav_menu_item[123]”, but Navception’s IDs look like “nav_menu_item[123-navception1]” This causes WordPress to throw the Illegal widget setting ID exception in class-wp-customize-nav-menu-item-setting.php . Removing the “-navception” suffix appears to fix the problem. Add this to Line 106: $args['navception_suffix_prefix'] = ""; Non-Navception menu IDs: nav_menu_item[123] Navception menu IDs: nav_menu_item[123-navception1] Updated Navception menu IDs: nav_menu_item[1231] Note the trailing 1. This number will increment for every Naception menu you include on your site. DISCLAIMER: I have not tested this fix in every scenario and it might not work in your situation. I’m not responsible for whatever may happen. I recommend NOT using an unsupported and unmaintained WP plugin, especially a broken one, but if you absolutely must, you can try this fix at your own risk ! This topic was modified 5 years, 3 months ago by acmdesigns .

Comments

0 shown

No comments were stored for this source.