WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Add new meta box with media upload only ( 2 other questions)

[Resolved] Add new meta box with media upload only ( 2 other questions)

  • Hi,

    is there a way to add a new meta box for uploading images (media) only without having to add the full wysiwyg editor?

    Can I also add a wysiwyg editor without the add media button?

    Finally, for links, would I just use a textbox or is there a specific field for links?

    Doing this to prevent the people who are going to use the site from getting confused.

    Thanks for the help and for the awesome plugin!

    http://wordpress.org/plugins/super-cpt/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Matthew Boynes
    Participant

    @mboynes

    Hi Tristan,
    Thanks for checking out the plugin! Here are the answers to your questions:

    is there a way to add a new meta box for uploading images (media) only without having to add the full wysiwyg editor?

    Yes, you can add a field of type ‘media’.

    Can I also add a wysiwyg editor without the add media button?

    Yes, there is a filter to modify the wp_editor settings, scpt_plugin_custom_meta_wysiwyg_settings. Here is the apply_filters call.

    Finally, for links, would I just use a textbox or is there a specific field for links?

    I was going to add one, but HTML5 beat me to it :-). Set the type to ‘url’, and the web browser will do the rest.

    Enjoy, and let me know if I can be of any more assistance!

    Cheers,
    Matt

    Plugin Author Matthew Boynes
    Participant

    @mboynes

    Forgot to mention, here’s the wp_editor reference. You’d want to add 'media_buttons' => false to the filtered array.

    Thanks for the reply! Everything worked 🙂

    steffanl
    Member

    @steffanl

    Hey,

    This helped me out a bunch too, thanks. However, I couldn’t figure out how to remove the “Add Media” button as well. Could you explain a bit more how to apply the scpt_plugin_custom_meta_wysiwyg_settings filter?

    Thanks,

    Steffan

    Try something like this

    function customizeWpEditor($param1,$param2){
        $param1['media_buttons']=false;
        return $param1;
    }
    add_filter('scpt_plugin_custom_meta_wysiwyg_settings','customizeWpEditor',10,2);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Add new meta box with media upload only ( 2 other questions)’ is closed to new replies.