How can I make a menu link visible only to admins (without plugins)?
You can show or hide something based on a user’s role with the current_user_can() function. For the Administrator role you would check if current_user_can( ‘administrator’ ). Here’s a quick and dirty example of hiding a nav menu item by first checking if the title matches a particular page, and then checking if the current user … Read more