WordPress – Insert images to post without Insert Media Window

Is it possible to insert images to a WordPress site with having to use the Insert Media window.

I have a forum type site where I would like people to be able to add images to post they can create but I don’t want them to be able to create Galleries of images etc.

Read More

I would just like the ability to add images from there system to the post like you can do on forums.

Is this at all possible.

Related posts

Leave a Reply

1 comment

  1. I believe in WordPress 3.9 you can drag and drop directly into wp_editor() – no need for media library so you can hide the button entirely on that post type. Another option is to limit the user-role to what they can and can’t do when it comes to the media library. Check out this answer over at the WordPress StackExchange

    Finally, you can probably limit what the user sees in the media library, meaning only limit it to what they’ve uploaded to that post. You can use this code below:

    /** Media Library - Only Show Images Uploaded To This Post **/
    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 
    }
    add_action( 'admin_footer-post-new.php', 'media_library_filter' );
    add_action( 'admin_footer-post.php', 'media_library_filter' );
    
    /** Hide Media Library DDL **/
    function hide_select_ddl(){
        ?>
            <style type="text/css">
                div.media-menu a.media-menu-item:nth-child(3) {display:none!important;}
                .media-frame-content .attachment-filters:first-child {
                    display:none;
                }
            </style>
        <?php
    }
    add_action( 'admin_head', 'hide_select_ddl' );
    

    What the above code does it only show images uploaded to the current post. You could go further and before the script is ran, decide to only run it on a post-type or only on a certain user-role. Hopefully this helps!