Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mega Menu Link widget in menu title saved to DB instead of querying to get title #2

Open
mikehatfield opened this issue Apr 6, 2018 · 1 comment

Comments

@mikehatfield
Copy link

If the title in a Mega Menu Link widget is updated and the widget has already been added to a menu under Appearance > Menus, the original name is still displayed.

For example:

In Widgets admin panel:
Drag "Mega Menu Link" into >> "Widgets In Menu"
Enter title and save: Fire Alarm Systems

In Menus admin panel:
Drag "Link: Fire Alarm Systems" into menu and save

Return to Widgets admin panel and update the same widget link title to "thisiscray", save.
Return to Menu admin panel, old title is still displayed.
Rendered on the front end, the correct title and URL are shown.

Looking at the database

In the wp_options table, where widget data is stored, the given "widget_custom_widget_mega_menu_link" has all correct, updated serialized data.

In the posts table, where the menu item appears to be stored, the post still has the old "Link: Fire Alarm Systems" title and post-name "link-fire-alarm-systems". If the widget menu link item was added multiple times to the menu, multiple post items will exist and none are updated. We'll have to take this into consideration.

I've been looking into the DB field structure and haven't figured out yet what the connecting attribute is that makes the relationship from menu item to the widget data in the options table. But it is obviously all hooked up. I'm guessing we'll have to add some logic to the process when saving a widget item also scan the post table for menu items and update the post_title and post_name fields. May be tricky.

@mattrabe
Copy link
Owner

mattrabe commented Apr 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants