Front end Upload file or image using WP Media

Support MB Frontend Submission Front end Upload file or image using WP MediaResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10194
    mis@linx.com[email protected]
    Participant

    Hi,

    I am using frontend submission for custom post type submit from frontend. I am using meta box with image_advanced and file_input fields types as custom meta. At time of uploading an images or files from frontend as subscriber , they can currently see the whole media library that's mean other users uploaded data they can see or select from media library.

    After upload it's showing media library with other users uploaded data that's wrong they can see only mine data. There is any solution for that please reply me as soon as possible. I have added below code for allow subscriber to upload file or image from frontend

    function mb_allow_subscriber_uploads() {
        if ( is_admin() ) {
            return;
        }
    
        // Replace 'subscriber' with the required role to update, can also be contributor.
        $subscriber = get_role( 'subscriber' );
        $subscriber->add_cap( 'upload_files' );
    }
    add_action( 'init', 'mb_allow_subscriber_uploads' );

    Thanks
    Ahmed

    #10195
    mis@linx.com[email protected]
    Participant

    It should only allow you to upload image or file not to view any past images for the users

    #10232
    Anh TranAnh Tran
    Keymaster

    Hi Ahmed,

    Please install the Restrict Media Library Access plugin. This plugin restricts access for users so they can only see their own Media Library uploads.

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