Add default content to post (for specific category)
default_content runs when a post is loaded into the editor, actually. You can check for categories when the post is saved, but you’d want the save_post hook, probably. You want to check the $_REQUEST global. add_filter( ‘default_content’, ‘my_editor_content’ ); function my_editor_content( $content ) { global $_REQUEST; if (isset($_REQUEST[‘post_category’]) && in_array($some_category_id,$_REQUEST[‘post_category’])) { $content = “My html … Read more