Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mdemrs/ca5e08cb7054a979f9d4 to your computer and use it in GitHub Desktop.
Save mdemrs/ca5e08cb7054a979f9d4 to your computer and use it in GitHub Desktop.
wp: redirect users to dashboard based on admin
//Redirect users to Dashboard based on Admin, wp tech Nantes, Benjamin Denis
$pages = array( 'tools', 'options-general', 'options-writing', 'options-reading', 'options-discussion', 'options-permalink', 'options-media'); //pages
foreach( $pages as $page )
add_action( "load-".$page.".php", 'wpc_block_users' );
function wpc_block_users() {
wp_redirect( admin_url() );
exit();
}
@mdemrs
Copy link
Author

mdemrs commented Mar 9, 2015

WP tech Nantes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment