Hi there, I’m trying to remove the “New Announcement” menu link in the front-end for users without manage options privs but the following function seems to remove the whole menu rather than just that menu link. I’ve tried variations of the “New Announcement” condition (‘new_announcement’,’New Announcement’, etc) but all seem to make the whole menu disappear. Any recommendations would be wonderful! thanks
Thanks for your reply Shamim! Actually I’m looking to allow non-admin users with manage_options caps to see the “New Announcement” button and be able to create new announcements. All other roles (except) admin need to be prevented from doing so. Can you recommend a way to do this?
Users with manage_options capability are admin. They should see that button not the other users.
Did you logged in as any other user (who does not have manage_options capability) and see if you see that button?
Thanks Shamim! Yes that’s what I was hoping to be the case but my issue is that my function above makes the whole menu disappear, rather than just the “New Announcement” menu button. Can you see anything wrong with my function that might cause this?
That worked! a misplaced close on the if statement. Rookie mistake. Thank you very much. Another question, is there a way to filter the list of recipient roles to ‘subscribers’ only when creating a new announcement?