Last active
August 29, 2015 14:16
-
-
Save mdemrs/ca5e08cb7054a979f9d4 to your computer and use it in GitHub Desktop.
wp: redirect users to dashboard based on admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WP tech Nantes