[wp-hackers] What filter/action function to use to change posting date before publishing?

Chris G cl at isbd.net
Tue Jan 26 18:34:45 UTC 2010


I'm a beginner at WordPress plugins (though an ancient programmer,
it's been my job since the early 1970s).

I'm trying to write a very simple plugin that will adjust a post's
Published date after the post has been created or changed.  I.e. I
want a hook that will call my plugin code when the Publish Immediately
or Update buttons are pushed before the post (or at least its date) is
written to the database.

The most likely candidate I can find at the moment is the
content_save_pre filter though as it's the date I want to change I'd
simply return the content unchanged after changing the date in the
$post array.

Am I on the right track?  I'm a bit worried by some Google results
which say that content_save_pre is deprecated and even that it has
been removed from WordPress 2.9.1.

Any/all comments and help welcome.

-- 
Chris Green



More information about the wp-hackers mailing list