[wp-hackers] Post meta revisions

scribu mail at scribu.net
Mon Nov 29 18:15:35 UTC 2010


On Mon, Nov 29, 2010 at 8:11 PM, John Blackbourn
<johnbillion+wp at gmail.com<johnbillion%2Bwp at gmail.com>
> wrote:

> Not sure about the best way to achieve this. Data in the post_meta
> table is stored against post IDs, not post revision IDs, so this won't
> work out of the box.
>
> Any suggestions or thoughts appreciated.
>

On the save_post hook:

$wpdb->update( $wpdb->postmeta, array( 'post_id' => $rev_id ), array(
'post_id' => $post_id ) );


More information about the wp-hackers mailing list