@qzha017
Hi, this might not be the best answer here but might be useful temporarily. Beside, as I can see on the statement above. Maybe you can replace the line:
if ( !current_user_can( $access_level ) && !in_array( $pagenow, $valid_pages ) ) {
wp_die( __( 'Access Denied. Your site administrator has blocked your access to the WordPress back-office.', 'wpuf' ) );
}
into something like:
if ( !current_user_can( $access_level ) && !in_array( $pagenow, $valid_pages ) ) {
header( 'Location: http://www.yoursite.com/404_page/' ) ;
}
I did this on some of my php sites. Please check if it may come in handy at your wordpress.
This may seem awkward but works right. You can do a custom page for 404 handling or make the Location into something that your site will never have. hahaha...
I am sorry if I am so dumb and lazy to do some novel code in equivalent of this short code.