I'm developing a plugin, with a login system.
I need to conditionally remove a menu entry from a nav menu on the frontend, if $_SESSION['member-user']
is set.
For example, I want a 'register' link to only appear if $_SESSION['member-user']
is not set
I did try to search in codex without success. Thank you!
EDIT:
To explain, the menu is configured from admin of wordpress website. I need to delete the link by my plugin. The menu is not echoed from my plugin, but configured from admin (the admin will use my plugin).
Thank you
NEW EDIT:
The process of my plugin is the following:
In "readme" you will read:
1 - create a page with shortcode [login] inside and connect to a menu voice "User" > "Login" 2 - create a page with shortcode [balance] inside and connect to a menu voice "User > "Balance"
If user is logged (not a wordpress user, login is external), I need to remove that first page "Login" (or "Register", not very important in this case)...
I hope it is more clear now... thank you to all!
if
statement with theisset
orempty
functions as the check would work. WordPress does't use sessions natively either