0

I'm trying to add Worpdpress editor on a modal page and in a different php file, but it doesn't show me the buttons, I put the screenshot

enter image description here

Also in the php file, First I hidden the editor to load the scripts.

<?php   
do_action( 'admin_print_footer_scripts' );
?>
<?php
 echo '<!--';
 wp_editor( '', 'customEditor', array(
       'media_buttons' => false,
        'textarea_rows' => 10,
        'teeny' => true
    ));
 echo '-->';

Then in the modal window I call back to the editor via ajax:

wp_editor(' ', 'customEditor',$settings); 
\_WP_Editors::enqueue_scripts();
\_WP_Editors::editor_js();

Edit: The problem is that it doesn't show me any errors in the console.

  • Have you checked the site with your browser's developer tools? Are there any issues in the markup or something logged to the browser console? – swissspidy Feb 7 '18 at 22:58
  • The problem is that it doesn't show me any errors in the console. – jcarlosweb Feb 7 '18 at 23:00
0

I fixed it by adding the following script after making the Ajax call:

tinymce.execCommand('mceRemoveEditor', false, 'customEditor');
tinymce.execCommand('mceAddEditor', false, 'customEditor');

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.