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
<?php | |
/** | |
* Grant access to the back-end to certain user roles | |
* | |
* @param bool $prevent_admin_access | |
* | |
* @return bool | |
*/ | |
function pmpro_grant_admin_access_to_dataanalyst( $prevent_admin_access ) { | |
if ( current_user_can( 'dataanalyst' ) ) { | |
$prevent_admin_access = false; | |
} | |
return $prevent_admin_access; | |
} | |
add_filter( 'pmpro_block_dashboard', 'pmpro_grant_admin_access_to_dataanalyst' ); | |
add_filter( 'woocommerce_prevent_admin_access', 'pmpro_grant_admin_access_to_dataanalyst' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment