Plugin conflict - If Menu (conditional menu logic)

I can’t say for sure, all I know is that after converting from X to Pro my conditional menu logic plugin “If Menu” is no longer being honored.

The If Menu plugin adds a GUI checkbox to each menu item in Appearance > Menus. The checkbox says “Enable Conditional Logic?” When checked, more option appear allowing me to apply conditional logic to each menu item, i.e. whether to show or hide it based on various criteria (logged-in, user roles, custom logic, etc.).

After switching over from X to Pro, the checkbox and GUI are still there, but all the preferences were lost. So I went back in and re-configured all my preferred menu conditional logic, but after clicking the Update Menu button all my choices were lost again and each menu item’s “Enable Conditional Logic?” checkbox was unchecked.

There are no console errors, even after hitting the “Update Menu” button. So I can only assume that this is a conflict with the Pro theme, which seems to make even more sense given the new options that Pro injects into each menu item in the Admin interface.

Can you please look into this asap? I have implemented a temporary quick fix, hiding/showing certain menu items with CSS via the .logged-in body class. But this method does not allow for my other custom conditions to work, so my site is currently presenting menu items to the wrong users, which is really bad. So I would really appreciated a quick response on this.

I should also mention that other inputs are successfully saving, like the Title and Class attributes. It is only the If Menu UI options that aren’t saving.

Here’s the plugin link again: If Menu

Many thanks!

  • Colin

Hey Colin,

Thanks for writing in! Please be advised that Pro is just another theme. You have to understand that for each theme like X, all settings, menu, widgets, and even plugin options were stored in a database just for X theme. When you switch your theme to another one like Pro or even Twenty Seventeen, you will have to set up again the settings, menu, widgets and even plugin options because this is a new theme. And if you are using a child theme, please make sure that when Pro is active, all your customizations will also need to be in a Pro child themes.

Hope this helps.

I’m sorry to say this, but I’m wondering if you even read my ticket…

First of all, what you say is completely false. Plugin options are not lost when switching themes. That is the whole point of a plugin.

Secondly in Themeco’s article/tutorial about converting from X Theme to the new Pro Theme, they specifically mention that “all settings and theme options will be migrated from X to Pro.” … and they were. So… I believe you were misinformed, which does not instill a great amount of confidence in Themeco’s support. Would you please pass this ticket along to another support agent please?

Thirdly, losing saved options from switching themes is not the issue here at all. The saved options that were lost were not theme related. They were plugin related, which is separate from the theme options entirely. The plugin in question is “If Menu”. There seems to be a conflict between the Pro theme and the If Menu plugin, which apparently prevents the “If Menu” options from being saved to the database and/or honored by wordpress.

Before I switched to the Pro theme, the If Menu plugin was functioning perfectly. But after switching to Pro, the If Menu plugin stopped functioning properly. I also notice there are new option fields on each menu item, inserted by the Pro theme. All the evidence points to the Pro theme being the source of the conflict that is preventing If Menu from functioning properly.

UPDATE:
I have now confirmed that the Pro theme is indeed where the conflict arises.

  1. I cloned my production site to a development environment and confirmed that the same issue was apparent (i.e. the If Menu options were not being saved).
  2. I deactivated and reactivated the If Menu plugin and tested again. Still not saving options.
  3. I reverted to X Theme by switching from my Pro child theme to X Theme in Appearance >> Themes and tested again. This time the If Menu options successfully saved.
  4. Then I switched back to Pro by activating the Pro theme (not my Pro child theme). After switching, not only were the If Menu options reset (overwritten), but I was again unable to save any If Menu options.
  5. I switched back to X Theme and noticed that the If Menu settings were still reset/overwritten. So I re-configured the If Menu settings and they successfully saved again.
  6. I then switched to the Wordpress Twenty Seventeen theme to test a non-Themeco theme. After switching to Twenty Seventeen the If Menu settings that I had configured while X Theme was active were still properly configured, which is the usual and normal behavior for plugin settings. In fact, that is the entire purpose of “plugins” versus “themes”; to allow for functionality that is independent of the theme.
  7. I then switched back to X Theme, and the If Menu settings stay intact.
  8. Finally I switched back to the Pro theme, and again, as expected, the If Menu settings were reset/wiped and could no longer be configured/saved.

This troubleshooting process tells me that the Pro theme is doing two things:

  1. Resetting or deleting any previously saved If Menu options.
  2. Preventing any If Menu options from being saved.

To me this is very clearly an issue with Pro, since If Menu functions as expected on both X Theme and the default Twenty Seventeen theme.

Please let me know if you are still confused about the issue I am asking about, or if I can clarify this in any other way for you.

I am hoping your team of developers can look into this apparent conflict. Hopefully they can try to replicated this issue by simply installing/activating the If Menu plugin, and then navigating to Appearance >> Menus and attempting to activate If Menu’s “conditional logic” for one or more menu items. Then hit the Update Menu button to save the settings and see if they are still configured properly after the page reloads. I would really appreciated if the Themeco team could confirm whether this is a conflict, and if so, perhaps they could work to fix it.

Thanks.

Hi there,

Thank you for detailed information regarding the troubleshooting you did. I installed the If Menu plug-in and as I have the WP debug functionality enabled I managed to cut this error:

Warning: : Invalid argument supplied for foreach() in : wp-content/plugins/if-menu/if-menu.php on line 236

The line which area is happening is this"

add_post_meta( $menu_item_db_id, ‘if_menu_condition_type’, $_POST[‘menu-item-if-menu-condition-type’][$menu_item_db_id][$index] );

I am not sure what is the problem caused and making this conflict, I will report this to our Development Team to follow up.

Please kindly consider that compatibility with third party plugins is not in the high priority category.

Standard disclaimer:

Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to Pro will need to be directed to the original developer.

Thank you for your understanding.

@adaptifyDesigns did you ever find a solution to this? I am currently trying to do a conditional menu with X theme Pro and if this “If Menu” plugin issue is resolved then I can save myself from writing my own php code.

Any details about how you went about fixing this issue would be greatly appreciated. :slight_smile:

Hi @pattimcletchie,

We’re not hearing any news or reports about this since then and we’re not sure if this is a bug. Have you tried contacting the plugin author if there are any special rules for it too integrates it to the menus properly? Or maybe it’s not just really compatible since Pro selectively choose menus based on user preference (like a custom menu compared to menu integrated to the templates).

Thanks!