WordPress.org

Ready to get started?Download WordPress

Forums

SuperCPT
[resolved] Add new meta box with media upload only (+2 other questions) (6 posts)

  1. Tristan
    Member
    Posted 8 months ago #

    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/

  2. Matthew Boynes
    Member
    Plugin Author

    Posted 8 months ago #

    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

  3. Matthew Boynes
    Member
    Plugin Author

    Posted 8 months ago #

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

  4. Tristan
    Member
    Posted 8 months ago #

    Thanks for the reply! Everything worked :)

  5. steffanl
    Member
    Posted 7 months ago #

    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

  6. Karzin
    Member
    Posted 1 month ago #

    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);

Reply

You must log in to post.

About this Plugin

About this Topic