admin管理员组

文章数量:1122846

I am using a front-end submission form for users to contribute posts to my platform. Users can upload text and images via the content area.

However, I would like to simplify the interface by limiting the 'Add Media' upload modal. Currently the modal, that allows users to insert images / media into the posts, shows a sidebar with media, image and audio galleries, and further, once a file was selected, users can see the Media Library and can edit the metadata (title, etc) in the Media Library tab.

Is there a way of modifying the popup modal 'Add Media', to simply let users select a single file from their local machine, and insert the file into the content area, without showing the Media Library etc.

I would still like to use the 'Add Media' upload, as from my understanding, it includes some security features, but I don't want users to see the modal popup, and instead just select a file which will be inserted into the post.

Also, the same for the drag and drop function, without using the modal or simplifying the modal.

This is my current code in the template:

// the content
        echo aui()->textarea( array(
            'id'          => 'template_post_content',
            'name'        => 'template_post_content',
            'placeholder' => __( 'content ...', 'uwp-frontend-post' ),
            'label'       => __( 'Content', 'uwp-frontend-post' ),
            'title'       => __( 'Content', 'uwp-frontend-post' ),
            'value'       => $post_content,
            'required'    => true,
            'rows'        => '5',
            'wysiwyg'     => array(
                'wpautop'       => true,
                'media_buttons' => true,
                'teeny'         => true,
                'quicktags'     => false,
                'tinymce'       => true,
                'drag_drop_upload'    => true
            )
        ) );

Thank you in advance for your help :)

本文标签: uploadsSimplifying 39Add Media39 Modal in frontend Content Editor