Fix wp-admin/admin-post.php access issue

This commit is contained in:
Champ Camba
2019-12-02 13:20:51 +08:00
parent ed334bdf0b
commit 9f9457cbd9
+4 -2
View File
@@ -7,12 +7,14 @@ if ( ! defined( 'ABSPATH' ) ) exit;
* Checks if user can access the backend
*/
function um_block_wpadmin_by_user_role() {
global $pagenow;
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
$action = empty( $_REQUEST['action'] ) ? '' : $_REQUEST['action'];
// filter that it's not admin_post or admin_post_nopriv request
$url_attr = parse_url( UM()->permalinks()->get_current_url() );
if ( is_user_logged_in() && ! empty( $action ) && $url_attr['path'] == '/wp-admin/admin-post.php' ) {
if ( is_user_logged_in() && ! empty( $action ) && 'admin-post.php' == $pagenow ) {
return;
}