Check if the menu name is present in an array and show/hide accordingly
-
Hi,
I have been searching on the internet for an example of visibility condition which is not in-built WordPress condition( like is_home()). From what I have come across, I am not able to figure out how to do what I need.
I want to show menu items which are present in an array in a custom made plugin.
For instance, I have an array $test_var = array(“welcome”, “Search”, “Display”); Now I want to give a visibility condition on each menu item to check if its name( or corresponding string ) is present in this array. If yes, the menu item should be displayed otherwise should not be displayed.Can you please help with this?
Thanks,
Neetha
- The topic ‘Check if the menu name is present in an array and show/hide accordingly’ is closed to new replies.