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 .js?ver=358-23224 404 (Not Found) wp-tinymce.php:1
Failed to load: .js wp-tinymce.php:1
GET .js?ver=358-23224 404 (Not Found) wp-tinymce.php:1
Failed to load: .js
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:
Share Improve this question edited Apr 13, 2017 at 12:37 CommunityBot 1 asked Apr 23, 2013 at 19:41 Ronny RookRonny Rook 1151 gold badge4 silver badges9 bronze badges 3GET http://www.domain/wp-includes/js/tinymce/langs/nl.js?ver=358-23224 404 (Not Found) wp-tinymce.php:1
Failed to load: http://www.domain/wp-includes/js/tinymce/langs/nl.js wp-tinymce.php:1
GET http://www.domain/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/wp-includes/js/tinymce/themes/advanced/langs/nl.js
- 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. – Andrew Bartel 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
Reset to default 1It 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)