Documentation: UberMenu Conditionals

Knowledgebase Docs » UberMenu Conditionals

Custom Conditions 9

If you need a conditional statement more advanced than the provided parameters, UberMenu Conditionals allows you to write a custom conditional filter. Please note this is an advanced tutorial and requires PHP and WordPress filter knowledge. This article provides guidance but these methods are considered customizations and are the customer’s responsibility The best place to put custom conditional filters would be in your child theme’s functions.php, or in a separate plugin. This is totally up to you and depends on how you manage your site. Registering Custom Conditions Registering a custom condition allows you to create new conditions which will appear in the UberMenu Menu Item Conditionals settings options. Here’s an example of a Condition, which checks if the user is on the front page and has permission to view lessons (an example capability that you might have if you’re selling a course) Direct Filter Using a direct filter will mean you control the display of the menu item via PHP, bypassing the UberMenu Menu Item Conditionals settings. Here’s an example of a custom conditional filter that makes sure a particular menu item will not display on the front page for logged in users.

View