• I created a code snippet to add a few additional user roles, but realized that I could do this with Advanced Access Manager. I tried to deactivate the code snippet but the new user roles still appeared throughout the site. I tried deleting the code snippet and still persisted. Finally I tried to delete the user roles using the AAM plugin – it worked for the first three but the last one is not able to be deleted. I understand the code PHP code snippets are added to the database – is there some manual way I can isolate the snippet that I tried to delete and remove it? Also, I have tried clearing the cache on my site and the object cache with my host with no difference.

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @shaunmehr,

    Modifying user roles is a permanent action. Unlike when using action and filter hooks, changes to users are written to the database, meaning they only need to happen once, and so are best suited for a run-once snippet.

    The code you added would have stopped running when you deactivated the snippet, but the changes you made will still be there.

    The only way to undo your changes is to work out what you did, and then apply further functions to restore to how things were before (e.g. removing roles you added, etc), or to restore from an older database backup.

Viewing 1 replies (of 1 total)

The topic ‘Removed code snippet but code persists’ is closed to new replies.