Post content not showing in the edit post textarea.
-
Hi All,
I’m currently building a plugin which requires me to remove the TinyMCE editor and replace with a text area.
The following code helps me to remove the TinyMCE editor from the admin area:
function wpdocs_remove_post_type_support() { remove_post_type_support( 'post', 'editor' ); } add_action('init' ,'wpdocs_remove_post_type_support' );
Then I add my own textarea with the following code:
function myprefix_edit_form_advanced() { require('texteditor.html'); } add_action( 'edit_form_after_title', 'myprefix_edit_form_advanced' );
My texteditor.html looks like this:
<html> <head> </head> <body> <div> <textarea id="text" name="post_content" data-placeholder="start writing..."> </textarea> </div> </body> </html>
After all the above code, I was able to save content using the textarea but when I got to the edit post area, no post content is showing up in the textarea field. My question is, is there any function I can call to make sure the text field is filled up in the edit post area.
I’d really appreciate any help.
Thanks.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Post content not showing in the edit post textarea.’ is closed to new replies.