Use http://wordpress.pastebin.ca
for posting long code. Thank you!
Doing it in edit-form-advanced does seem like the simplest way to go.
You’ll find this bit of code in there:
<div><textarea <?php if ( user_can_richedit() ) echo 'title="true" '; ?>rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="2" id="content"><?php echo user_can_richedit() ? wp_richedit_pre($post->post_content) : $post->post_content; ?></textarea></div>
If you eliminate the stuff we don’t care about, you’ll see that it really breaks down to this:
...<textarea name="content"> some php code to put post_content here</textarea>...
That’s how the editing works. For new posts, post_content is empty. For editing older posts, it contains the post_content.
So you can do something like this just one line up:
<?php
if (empty($post->post_content)) {
$post->post_content = "stuff you want in the post by default";
}
?>
<div><textarea ... blah blah ...
And that should work.
That worked great. Thank you.
That worked perfectly for me too, until I upgraded to WordPress 2.1.
Any ideas on how to incorporate this into the new edit-form-advanced?
Line 146 shows:
<fieldset id=”<?php echo user_can_richedit() ? ‘postdivrich’ : ‘postdiv’; ?>”>
<legend><?php _e(‘Post’) ?></legend>
<?php the_editor($post->post_content); ?>
</fieldset>
I use a modded version of a technorati tag adder for wordpress.com using greasmonkey for my self hosted blog. Maybe you can use the GM script to auto load the text?
My apologies, the hack works. Maybe I needed to refresh my cache?
Anyhow added:
<?php if (empty($post->post_content)) {$post->post_content = “Short summary of the resource. Edit this as needed.”;}?>
Above this existing line in edit-form-advanced.php
<?php the_editor($post->post_content); ?>