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

Block admin for all users but administrator

wordpress snippet

If you need to block all users but the administrators from wp-admin just add this snippets to the functions.php of your wordpress theme. This snippet will redirect everyone but the admin back to the primary domain.

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

Display all subscribers in an unordered list

wordpress snippet

Adding this snippet to your wordpress theme will display all subscribers in an unordered list

read more

Display list of authors in a dropdown menu using wp_dropdown_users

wordpress snippet

Adding this snippet to your wordpress template will display a list of authors within a dropdown menu linking to their author profiles. I also excluded the default user ‘1’ as the administrators would also be display. This is a comma separated list so you can remove any users that you don’t wish to display.

read more

Add total members to “Right Now” dashboard widget

wordpress snippet

Great little snippet that will display the total number of members within the Right now dashboard widget. Just add this to the functions.php of your wordpress theme and you are ready to go.

read more

Remove personal options from user profiles

wordpress snippet

Adding this snippet to the functions.php of your wordpress theme will remove the personal options from users profiles.

read more