Pre-populating the Page/Post Content Editor with HTML Snippets?

@Scott B,
I just read a post on Justin Tadlocks Blog regarding this same issue.

The Solution

Use the default_content filter hook and it to the themes function.php file.

Example:

<?php

add_filter( 'default_content', 'my_editor_content' );

function my_editor_content( $content ) {

    $content = "This is some custom content I'm adding to the post editor because I hate re-typing it.";

    return $content;
}

?>

You could add XHTML or anything you wanted to the $content string

When you click “Add New Post” you get:
alt text

Leave a Comment