0

A few days ago I asked this question.

Today I started building a new website in which I copied the code of my plugin used at the website from my previous question.

And I was surprised when I saw that the exact same code that was bugging at my previous website is working perfectly fine in the new website I'm building.

For the people who did not read my previous topic: At my another website WP_editor is opening in the 'Plain text' field. I can type there and use options like Bold, Italic etc. As soon I switch to the Visual tab, my text is deleted just as all the options. All I see is a blanco tab which cannot be edited.

The code I'm using to display the editor:

 add_action( 'edit_page_form', 'content' );
                wp_editor(
                    "Sample",
                    'content',
                    array( 'textarea_name' => 'content' )
                );

Is someone familiar with this problem or someone who knows a solutions for this? Thanks in advance!

EDIT: Getting the following errors:

GET http://www.domain.com/wp-includes/js/tinymce/langs/nl.js?ver=358-23224 404 (Not Found) wp-tinymce.php:1

Failed to load: http://www.domain.com/wp-includes/js/tinymce/langs/nl.js wp-tinymce.php:1

GET http://www.domain.com/wp-includes/js/tinymce/themes/advanced/langs/nl.js?ver=358-23224 404 (Not Found) wp-tinymce.php:1

Failed to load: http://www.domain.com/wp-includes/js/tinymce/themes/advanced/langs/nl.js

3
  • I'm not sure it's safe to call your custom field 'content'. Try renaming it.
    – vancoder
    Commented Apr 23, 2013 at 19:50
  • I've done it naming the field content, but it was the only editor on the page. Commented Apr 23, 2013 at 20:15
  • I've read the first question and added the proper way to use the wp_editor in a plugin page
    – DrMosko
    Commented Dec 21, 2015 at 3:22

1 Answer 1

1

It doesn't look like you're calling add_action() correctly. It should be more like:

add_action( 'edit_page_form', 'wpse96952_editor' );
function wpse96952_editor() {
    wp_editor(
        "Sample",
        'mycontent',
        array( 'textarea_name' => 'mycontent' )
    );
}

(content changed to mycontent after I read @vancoder's comment)

2
  • I've added some new errors I currently get
    – Ronny Rook
    Commented Apr 23, 2013 at 20:15
  • Do you still have the problems if you disable your plugins and switch to a WordPress default theme like Twenty Twelve?
    – Pat J
    Commented Apr 23, 2013 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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