wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Change default role names “Administrator, Editor, Author, Contributor, Subscriber” to anything

wordpress snippet

Have you ever wanted to change the default role names “Administrator, Editor, Author, Contributor, Subscriber” within wordpress? Add this little snippet to the functions.php of your wordpress theme. This snippet will let you change any of the existing role names to anything that you would like. This will of course display within the role select menu for users.

“Please note this does not add a new role or permanently change the name”

read more

List All Available wordpress Roles

wordpress snippet

Here is a snippet showing how to list all available roles. I recently used this snippet to add a role selector in the registration page. You could also use it for user searches, or post filters.

read more

Redirect based on user roles or capabilities

wordpress snippet

Redirecting based on a user role or capabilities could be a valuable addition depending on the needs of your WordPress site. This would allow you to redirect specific capabilities to a custom page with details about new content or features. You could also use this to redirect users with higher user roles directly to the WordPress wp-admin. For more details on the capabilities available in wordpress visit the wordpress codex. To use this snippet just add it to the functions.php of your wordpress theme and you will be redirect users based on roles or capabilities like a pro.

read more