Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
WordPress user admin redirect
* redirect to homepage if has non "edit_posts" capabilities
add_filter("admin_init", function () {
if (!current_user_can('edit_posts')) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment