Skip to content

Instantly share code, notes, and snippets.

  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<?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