Published on
Dec 26, 2024
Updated on
Jan 02, 2025
Share

Improve menu visibility with WPMasterToolkit's Nav Menu Visibility module

Managing the visibility of navigation menu items on your WordPress site can be a challenge, especially when you want to display certain items only to logged-in or logged-out users. With this in mind, we've developed the Nav Menu Visibility of our WPMasterToolkit plugin. This module offers a simple solution for controlling which users see which menu items, without the need for additional plugins or complex coding.

Which plug-in can the Nav Menu Visibility module replace?

Nav Menu Visibility can replace several popular WordPress plugins dedicated to managing menu items based on the user's login status. These include plugins such as User Menus and Nav Menu Roles. By using WPMasterToolkit, you save resources by installing just one plugin to handle a variety of needs.

Discover the module : Hide PHP versions

How does the Nav Menu Visibility module work?

The module works by adding radio buttons to the menu item parameters, allowing you to define the visibility of each item. You can choose to display an item for everyone, only for logged-in users, or only for logged-out users. This choice is saved as metadata associated with each menu item, meaning you can easily adjust the visibility of your menus without modifying the underlying code.

How do I use this module?

To use the module, simply access the menu settings in your WordPress dashboard. For each menu item, you'll now be able to select which of the three visibility states you'd like to apply: "Connected", "Disconnected", or "Everyone". Once you've made your selections, simply click "Save" for your settings to take effect.

Screenshot of the WordPress navigation menu.

Custom actions and filters used in Nav Menu Visibility

The module uses several important WordPress hooks to implement its functionality. First, the wp_nav_menu_item_custom_fields is used to add custom radio buttons to menu item settings. Next, the wp_update_nav_menu_item saves the selected visibility state. Finally, the wp_get_nav_menu_items is used to adjust the menu items displayed according to the user's connection status.

Understanding the technical choices behind Nav Menu Visibility

We've chosen to integrate this functionality directly into the administration user interface, as it maintains fluid, intuitive menu management without adding unnecessary complexity. By using WordPress post metadata, we ensure that data integrity is preserved and that these visibility settings don't disrupt the normal flow of other operations on your site.

Pro
from
2.50$
/Month
14
Days
Money-back guarantee
risk-free at 100 %!

Conclusion

WPMasterToolkit's Nav Menu Visibility module is an elegant, integrated solution for controlling the visibility of menu items in WordPress. By replacing the need for visibility-specific third-party plugins, it enables more centralized and efficient management of your menus. With this module, you can easily ensure that the right users see the right navigation options, improving the overall user experience of your WordPress site.

Category
Contents & Media
Version
≤ 1.3.0
Type
Free
More than 18 reviews
+1000
Installations
104
Modules
Pro
from
30.00$
/Year