the_editor_content filter change the content of other textarea in wp admin in add/edit post section?

1.2k views Asked by At

I have more then one text areas in wp admin in post add/edit section, i am trying to change the content of by default textarea of wp but when i execute the the_editor_content filter, it change the content of by default textarea but it also change the content of other textareas,is there any way to to change the content of only by default textarea?

Note* Other textareas have different ids

code i used :

add_filter( 'the_editor_content', 'my_editor_content' );
function my_editor_content() {
    global $post;
    return search_keywords($post->post_content, $keyword1,$keyword2,$keyword3);
}
1

There are 1 answers

1
David Chase On BEST ANSWER

I think you need to hook into default_content like this

add_filter( 'default_content', 'my_editor_content' );

function my_editor_content( $content ) {

$content = "This is my default content!";

return $content;
}