Default content for a post in one category?

One possibility is this question/answer here by Jan Fabry, which asks for the default content in the process of creating the new post:
Force category choice before creating new post?

I ended up using a Quicktag as a way of easily getting the content into a post, and because the default content happened to be html, it works as good as it can for now. But in the future there turns out to be a way to get default content into a post when that post is saved in that category, that will be good.

Quicktags function for functions.php:

//Custom Quicktags Function

function my_quicktags() {
    wp_enqueue_script('custom_quicktags',
    get_bloginfo('template_directory').'/custom-quicktags.js', array('quicktags'));
}
add_action('admin_print_scripts', 'my_quicktags');

Sample Quicktags code for custom-quicktags.js, which goes in the theme folder:

edButtons[edButtons.length] =
new edButton('newbutton1'
,'TagButtonName'
,'html, like <div>'
,'and more </div>'
,''
);

Leave a Comment