0
votes

I am writing a WordPress plugin which will include default text (i.e. a text template) into every new blog post that the user creates.

Is there an action I need to call in order to do this? I can't see a relevant one here http://codex.wordpress.org/Plugin_API/Action_Reference

1

1 Answers

1
votes

what you will have to do is create a new function along with a new filter so that each post that is submitted will be run through your new function, which will include and append the template text, which will then be processed by your new filter,

ie:

function my_templte_post($data) {
  $data = array(
     'post_content' => 'this is my template text.'
  );
  return $data;
}
add_filter( 'wp_insert_post_data' , 'my_templte_post' , '99' );

this is untested, but basicly thats along the lines you want.. I think!