Custom Fields
Re-Envisioned
Support MB Frontend Submission Front end Upload file or image using WP Media

This topic contains 2 replies, has 2 voices, and was last updated by  Anh Tran 1 year, 2 months ago.

  • Creator
    Topic
  • #10194
    Resolved
    mis@linx.com
    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #10195

    mis@linx.com
    Participant

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

    #10232

    Anh 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 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.