• hello, this plugin saves me from having a lot of snippets to paste in my site, but despite this, I still have a problem,
    I need to tell wordpress to display only the images attached to the post only.

    I did a test to illustrate the problem to you
    Image test

    and here the code snippet I’m using for this task.

    add_action( 'admin_footer-post-new.php', 'media_library_filter' );
    add_action( 'admin_footer-post.php', 'media_library_filter' );
    function media_library_filter() { 
        ?>
        <script type="text/javascript">
            jQuery(document).on("DOMNodeInserted", function(){
                jQuery('select.attachment-filters [value="uploaded"]').attr( 'selected', true ).parent().trigger('change');
            });
        </script>
        <?php 
    }

    but apparently it doesn’t work well now after several updates of ACF and wordpress and maybe other things. i have bugs .. what is certain. he is not reliable now

    can you integrate this as an option to check?

    otherwise I found other codes and articles but nothing seems to work this could help you to understand.

    I thought I was done with this problem but unfortunately today it becomes a priority

    Source 1 codes

    Source 2 codes

    Source 3 codes

Viewing 1 replies (of 1 total)
  • Thread Starter neosan

    (@nreljed)

    Hello again,
    to explain the reason for this need,
    I created a real estate site, each post is a property and each image is unique and related to its property. therefore the user does not need to see the other images of the other properties.
    There is nothing interesting to add it will be total confusion..

    He only needs to see the attached images and add new images

    I Hope it was clear and it makes sense to you

Viewing 1 replies (of 1 total)
  • The topic ‘Restricting Users to View Only Media Library Items They Upload to post’ is closed to new replies.