Change WordPress user roles and capabilities Forums Bug Reports Enabling Media Library for Authors & Editors

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #3219
    dfroberg
    Participant

    We have a rather large media library so thought it would be nice if other journalists was actually able to use it and share media, so dove into the URE Forums and found the solution, followed the instructions, or so I thought 😉

    Added;

    
    /**
     * Enable Editors & Authors to see entire media library
     * @param $show_all
     *
     * @return bool
     */
    function show_full_list_of_attachments($show_all) {
    	if (!current_user_can('editor') ||
    	    !current_user_can('author')
           ) {
        	return $show_all;
    	}
    	return true;
    }
    add_filter('ure_attachments_show_full_list', 'show_full_list_of_attachments', 10, 1);
    

    To the functions.php of the theme and lo and behold; it works, BUT only for list view in media manager and NOT in thumbnail view in media library nor in Add Media (which for some reason only shows thumbnails *sigh* )

    Ideas?

    #3227
    Vladimir
    Keymaster

    I can not reproduce this difference between list and thumbnail views.

    I see a mistake in logic. This filter will never return true for user with single ‘editor’ role or user with single ‘author’ role, as 1st definitely can not ‘author’, but 2nd can not ‘editor’.

    Try to replace permissions check part with this one:

    
    if (!current_user_can('editor') &&  !current_user_can('author')) {
        return $show_all;
    }
    
    #3311
    dfroberg
    Participant

    Yeah I saw that after I posted and corrected it 🙂
    Also tried with just returning true to no avail.

    #3312
    Vladimir
    Keymaster

    Try to temporally deactivate all plugins except URE to exclude a conflict with some other plugin. Reactivating plugins back one by one can help to isolate a problem.

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