I’m trying to add some default content to my posts using this code in my functions.php:
add_filter( 'default_content', 'my_editor_content' );
function my_editor_content( $content ) {
$content = "My html content.";
return $content;
}
It works fine, but I would like to add the content to some categories only. This is tricky because the default content gets added while creating a new post, (so it is without a category). I followed this thread:
Force category choice before creating new post?
and the author came up with a way of forcing you to choose a category before wp creates the new post, but I don’t know how to edit the default content code so it is only applies to some categories?