{"id":1836,"date":"2024-12-26T12:40:24","date_gmt":"2024-12-26T11:40:24","guid":{"rendered":"https:\/\/wpmastertoolkit.com\/module\/visibilite-du-menu-de-navigation\/"},"modified":"2025-01-02T18:10:40","modified_gmt":"2025-01-02T17:10:40","slug":"visibilite-du-menu-de-navigation","status":"publish","type":"module","link":"https:\/\/wpmastertoolkit.com\/en\/module\/navigation-menu-visibility\/","title":{"rendered":"Navigation menu visibility"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Improve menu visibility with WPMasterToolkit's Nav Menu Visibility module<\/h1>\n\n\n\n<p>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 <strong>Nav Menu Visibility<\/strong> 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Which plug-in can the Nav Menu Visibility module replace?<\/h2>\n\n\n\n<p>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 <em>User Menus<\/em> and <em>Nav Menu Roles<\/em>. By using WPMasterToolkit, you save resources by installing just one plugin to handle a variety of needs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does the Nav Menu Visibility module work?<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I use this module?<\/h3>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img alt=\"Screenshot of the WordPress navigation menu.\" fetchpriority=\"high\" decoding=\"async\" width=\"918\" height=\"809\" src=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-66.png\" class=\"wp-image-3129\" srcset=\"https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-66.png 918w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-66-300x264.png 300w, https:\/\/wpmastertoolkit.com\/wp-content\/uploads\/2024\/12\/image-66-768x677.png 768w\" sizes=\"(max-width: 918px) 100vw, 918px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Custom actions and filters used in Nav Menu Visibility<\/h2>\n\n\n\n<p>The module uses several important WordPress hooks to implement its functionality. First, the <code data-no-auto-translation=\"\">wp_nav_menu_item_custom_fields<\/code> is used to add custom radio buttons to menu item settings. Next, the <code data-no-auto-translation=\"\">wp_update_nav_menu_item<\/code> saves the selected visibility state. Finally, the <code data-no-auto-translation=\"\">wp_get_nav_menu_items<\/code> is used to adjust the menu items displayed according to the user's connection status.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding the technical choices behind Nav Menu Visibility<\/h2>\n\n\n\n<p>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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>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.<\/p>","protected":false},"excerpt":{"rendered":"<p>WPMasterToolkit's Nav Menu Visibility module improves the visibility management of menu items on WordPress by allowing these items to be displayed according to the user's login state (logged in, logged out, or everyone) without the need for additional plugins or complex coding. This module replaces plugins such as User Menus and Nav Menu Roles, optimizing the use of resources. It works via radio buttons embedded in the menu settings of the WordPress dashboard. Using WordPress hooks, it simplifies menu management while ensuring data integrity, enhancing your site's user experience.<\/p>","protected":false},"featured_media":0,"parent":0,"template":"","meta":{"_acf_changed":true,"_seopress_robots_primary_cat":"","_seopress_titles_title":"Boostez votre menu WordPress avec Nav Menu Visibility!","_seopress_titles_desc":"Contr\u00f4lez la visibilit\u00e9 des menus WordPress facilement avec le module Nav Menu Visibility de WPMasterToolkit. Simple et sans codage complexe !","_seopress_robots_index":"","_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true},"class_list":["post-1836","module","type-module","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module\/1836","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/module"}],"about":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/types\/module"}],"wp:attachment":[{"href":"https:\/\/wpmastertoolkit.com\/en\/wp-json\/wp\/v2\/media?parent=1836"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}