WordPress Editor not getting youtube video preview

When I am creating a post from the admin panel and using a youtube link in the Editor, the editor automatically fetching the video from youtube and displaying right away in the editor.

enter image description here

But When i am using custom code to display the editor in the frontend and putting the youtube URL its not getting the preview of the video.

enter image description here

Is there any specific parameter to pass to the editor for YouTube videos !!

Here is my current code,

$settings = array( 'media_buttons' => false, 'editor_height' => '140px');
$editor_id = 'video_content';
wp_editor( '', $editor_id, $settings );

Any idea how to accomplish this !!

2 Answers
2

Perhaps obvious- you’ve put the URL in the “visual” tab of the editor. Check the “Text” tab and ensure that this isn’t wrapping your URL with paragaraph tags and therefore outputting the URL as text. For simplicity, I would turn the “Video Content” meta box into a regular text field.

Hope that helps!

Leave a Comment