tags:

views:

15

answers:

1

Hi all,

need to change post content before it is published. I could overwrite the native publish function but don't want to do this.

What i'd like to do is something like:

add_action('before_publish_post','my_func');
function my_func($content){
    $content = "new content";
    return $content;
}

I have had a look at the 'publish_post' hook, but this only allows me to change the post content afer it has been published, not before.

any help would be appreciated, cheers

+1  A: 

Use save_post hook.

You can read more here: http://codex.wordpress.org/Plugin_API/Action_Reference

infinity