• Resolved Edfrank

    (@edfrank)


    Hey there,

    First of all I’d like to convey that I love this plugin. I have used it to replace “The Other” Nav Menu plugin mainly because I like the dropdown selector and the added functionalities.

    I made some minor changes to the nav-menu-edit-custom-fields.php file for better functionality.

    Here are the changes I implemented:

    • Newer Walker Class: The script now uses Walker_Nav_Menu for broader compatibility with recent WordPress versions.
    • Dedicated Hook: It replaces the regular expression with the walker_nav_menu_start_el hook to insert custom fields during menu item rendering. This is a more reliable approach.
    • Field Sanitization: The script includes wp_kses_post to sanitize user input within custom fields before outputting them. This helps prevent potential XSS vulnerabilities.
    • Note:
    • This script still relies on plugins and themes using the?wp_nav_menu_item_custom_fields?hook to define their custom fields.

    Hope this helps.

    • This topic was modified 11 months, 1 week ago by Edfrank.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Daniel Iser

    (@danieliser)

    @edfrank – Feel free to submit a PR on our github. That said I’d have to review all of the changes your proposing as we along with dozens of other plugins are all doing a very specific way to ensure maximum compatibly. I wasn’t under the impression WP core had changed anything to fix the deficiencies we all (other plugins) made workarounds for, but happy to investigate. Got a link to any docs/make posts?

    Plugin Author Daniel Iser

    (@danieliser)

    Oh and you keep referencing “the script” or “this script” but made no mention of what you were actually referring to if you care to elaborate.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Better Compatibility and Functionality Suggestion…’ is closed to new replies.