Aangemaakte reacties

3 reacties aan het bekijken - 1 tot 3 (van in totaal 3)
  • Thread starter aw2

    (@aw2)

    … ben er nu nog mee aan de slag ;

    Thread starter aw2

    (@aw2)

    Easy albums is zeker een mooie plugin.

    Ik ben hier wel dit tegengekomen wat zou moeten doen wat ik nodig heb.
    Het is me alleen nog niet gelukt om het werkend te krijgen…

    You could always filter the media list using a pre_get_posts filter that first determines the page, and the capabilities of the user, and sets the author parameter when certain conditions are met..

    Example
    ________________

    add_action('pre_get_posts','users_own_attachments');
    function users_own_attachments( $wp_query_obj ) {
    
        global $current_user, $pagenow;
    
        if( !is_a( $current_user, 'WP_User') )
            return;
    
        if( 'upload.php' != $pagenow )
            return;
    
        if( !current_user_can('delete_pages') )
            $wp_query_obj->set('author', $current_user->id );
    
        return;
    }

    ________________

    I used the delete pages cap as a condition so Admins and Editors still see the full media listing.

    There is one small side effect, which i can’t see any hooks for, and that’s with the attachment counts shown above the media list(which will still show the total count of media items, not that of the given user – i’d consider this a minor issue though).

    Thread starter aw2

    (@aw2)

    Dank valandil!
    Je link is mooi maar niet helemaal wat ik zoek.

    Ik heb verschillende contributors die afbeeldingen plaatsen.
    De contributors moeten alleen hun eigen afbeeldingen kunnen beheren. Ze mogen dus alleen hun eigen afbeeldingen kunnen zien in de media library en niet die van andere contributors.
    Alle afbeeldingen en media die niet van de Contributor zelf is moet niet zichtbaar zijn in de Media Library.

    Dank!

3 reacties aan het bekijken - 1 tot 3 (van in totaal 3)