0

I can't see my media library for my custom role "restricted user". The capabilities works well for the rest, but I can't see any image in my library (with this role only).

The ajax loading is working (success : true), but the media keeps loading on my post type.

I'm using Publisspress Capability.

enter image description here

Update

It doesn't seem to be a capability problem. I have a function that hide some menu entry for some roles. If the function is activated, the media are not loading.

This is my code :

add_action('admin_init', 'themeremove_menu_pages', 999);
function themeremove_menu_pages()
{

    global $user_ID, $current_user;

    $roles = (array)$current_user->roles;


    if (in_array('editeur_revues', $roles)) {
        remove_backend_access_common(); //media not loading
    }

    if (in_array('editeur_restreint', $roles)) {
        remove_backend_access_common(); // media not loading
    }

    if (in_array('edit_revue', $roles)) {
        //remove_backend_access_common(); //media are loading
    }

}

function remove_backend_access_common()
{
    remove_menu_page('mo_ldap_local_login');
    remove_menu_page('wp-user-avatar');
    remove_menu_page('export-personal-data.php');
    remove_menu_page('options-general.php');
    remove_menu_page('edit.php?post_type=acf-field-group');
    remove_menu_page('menu-posts-block_lab');
    remove_menu_page('likebtn_buttons');
    remove_menu_page('edit.php?post_type=staff');
    remove_submenu_page('edit.php', '?post_type=staff&page=order-post-types-staff');
    remove_menu_page('menu-posts-staff');
    remove_menu_page('wp-mail-smtp');
    remove_menu_page('order-post-types-pictorially');
    remove_menu_page('galleries_bwg');
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.