0

for my own plugin I have a create-form which includes at least two editor fields and I insert them like this

wp_editor('', 'dbfield');

The editor is shown in the form, it gets saved into the database and the output also looks like it should. However, when I try to use the embed shortcode (for a youtube video), I only get a loading-placeholder. When I use the same embed in a default Wordpress form (new page), the embed works.

Am I missing settings that I need to embed? I thought everything is used as default when I use wp_editor without additional settings like that.

Any help would be appreciated.

I also noticed that the editor does not look exactly like the default one, it is missing the "Distraction-free writing mode" button for example. I don't need it in the plugin, but maybe it is an indicator that I do miss some default settings?

edit 1: The file mce-view.js (wp-includes/js/) throws an error because the property "media.view.settings.post.id" is 0. So far I use the workaround to set a different (existing) post id when the property returns 0. But there's clearly an issue with my plugin that I need to check further.

0

The WordPress OEmbed should show in the editor by default.

If it doesn't, I suspect that you need to enqueue some scripts and styles on your page where you are using wp_editor. Eg:

wp_enqueue_script('editor', false, false, false, true); wp_enqueue_script('quicktags', false, false, false, true); wp_enqueue_script('wplink', false, false, false, true); wp_enqueue_script('wpdialogs-popup', false, false, false, true); wp_enqueue_style('wp-jquery-ui-dialog', false, false, false, true); wp_enqueue_script('word-count', false, false, false, true); wp_enqueue_script('media-upload', false, false, false, true); wp_admin_css(); wp_enqueue_script('utils', false, false, false, true);

  • Thank you for your answer. I've tried but it didn't seem to make a difference. Is there any way I can debug to see which script I might be missing? – user20837 Jun 6 '18 at 12:56
  • I also noticed that my editor plugin lacks 1 or 2 buttons that the "new page" editor has. I don't need those buttons but shouldn't they also show up in the plugin when they're part of the default editor configuration? – user20837 Jun 6 '18 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.