ure_admin_menu_access_allowed_args

ure_admin_menu_access_allowed_args filter is used in Admin menu access additional module. It allows to exclude blocking of allowed links if they use some additional parameters.

For example, you blocked some menu items for role, which uses ‘edit.php’ in their links (custom post types). Your role works well with allowed custom post type, but when you try to set filter on the list of post user is redirected suddenly to the dashboard. What’s happened? “Admin menu access” module check any URL if it’s allowed. If URL contains any parameter not included into allowed list, such URL is blocked and automatic redirection to the 1st available menu item takes place.

Like “Events Manager” plugin adds a ‘scope’ parameter to its URL. Compare a default URL ‘edit.php?post_type=event’ and ‘edit.php?post_status=all&post_type=event&m=0&scope=today&filter_action=Filter&paged=1’ URL after you set a filter for “Today’s” event. All other arguments except ‘scope’ are default (buit-in to WordPress) for any post type and User Role Editor Pro knows about them. But ‘scope’ is unknown. So when you try to filter events for the role with a restricted access to admin menu such URL will be automatically blocked.

ure_admin_menu_access_allowed_args filter allows to resolve this conflict:

add_filter('ure_admin_menu_access_allowed_args', 'allow_events_filter', 10, 1);

function allow_events_filter($args) {

    $args['edit.php'][''][] = 'scope';
    
    return $args;

}

Look at the pro/includes/classes/admin-menu-url-allowed-args.php file code inside plugins/user-role-editor-pro folder to get more details about $args array structure.