Change WordPress user roles and capabilities Forums Bug Reports Prohibit users access to admin not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7807
    [email protected]
    Participant

    Hello, I followed the code example about prohibit access to admin, but recently, this function may redirect Admin to the home page, some plugins added roles disappeared sometime, some plugin tabs on the navigation bar were also disappeared, I noticed that you have remove this code from this article, that means you may have known this bug? Thanks

    ure_role_additional_options

    /**Admin access prohit added by user role editor
    add_filter( ‘ure_role_additional_options’, ‘add_prohibit_access_to_admin_option’, 10, 1 );

    function add_prohibit_access_to_admin_option($items) {
    $item = URE_Role_Additional_Options::create_item( ‘prohibit_admin_access’, esc_html__(‘Prohibit access to admin’, ‘user-role-editor’), ‘init’, ‘prohibit_access_to_admin’ );
    $items[$item->id] = $item;

    return $items;
    }

    function prohibit_access_to_admin() {

    if ( is_admin() && !wp_doing_ajax() ) {
    wp_redirect( get_home_url() );
    }
    }

    **/

    #7814
    Vladimir
    Keymaster

    Hi,

    Code is still available at the mentioned article. It does not remove any roles and/or admin menu items.
    Check if this option checkbox is not turned ON accidentally for the ‘administrator’ role.
    Refresh your site caching support (plugins and system routine, like CDN, etc.).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.