tinymce - Post content not showing in the edit post textarea. (Wordpress) -




i’m building plugin requires me remove tinymce editor , replace text area.

the following code helps me remove tinymce editor admin area:

function wpdocs_remove_post_type_support() {     remove_post_type_support( 'post', 'editor' ); }  add_action('init' ,'wpdocs_remove_post_type_support' ); 

then add own textarea following code:

function myprefix_edit_form_advanced() {   require('texteditor.html');   }     add_action( 'edit_form_after_title', 'myprefix_edit_form_advanced' ); 

my texteditor.html looks this:

<html>  <head>  </head>  <body>   <div>   <textarea id="text" name="post_content" data-placeholder="start writing...">    </textarea>    </div>   </body>  </html> 

after above code, able save content using textarea when got edit post area, no post content showing in textarea field. question is, there function can call make sure post content shows in textarea.

i’d appreciate help.

thanks.

you can remove code , replace with:

function replace_tinymce_by_textarea( $settings, $editor_id ) { if ( $editor_id == 'content' ) {     $settings['tinymce']   = false;     $settings['quicktags'] = false;     $settings['media_buttons'] = false; } return $settings; }  add_filter( 'wp_editor_settings', 'replace_tinymce_by_textarea', 10, 2 ); 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -