Gravity Forms lets you turn on the media library button for the rich text editor fields but you have to do it via php. More stuff on your editor options is here.
If you leave things that way, it’s nice but if you cut/paste a YouTube URL it comes in as a link rather than auto-embedding. Given my main goal with a lot of these Gravity Form workflows is to make it super easy I wanted that option to work. To get that to happen I need to enqueue some of the editor scripts on the frontend where the editor lives.
This little plugin will take care of both things.
//turn on media library function show_media_button( $editor_settings, $field_object, $form, $entry ) { $editor_settings['media_buttons'] = true; $editor_settings['wpautop'] = true; return $editor_settings; } add_filter( 'gform_rich_text_editor_options', 'show_media_button', 10, 4 ); //loads script to do the oembed stuff function alt_lab_front_end_scripts(){ wp_enqueue_editor(); wp_enqueue_script( 'mce-view', '', array('tiny_mce') ); } add_action( 'wp_enqueue_scripts', 'alt_lab_front_end_scripts' );
You can see a quick explanation of where this comes into play in the video below. You’ll also get the chance to see one example of how I give faculty quick tours of sites and hear my mellifluousWhile I struggle to say that word, I do enjoy writing it. voice.