Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I use wp_update_post() in a Frontend Page. The first part of the function works as expected. post_content and/or post_title will be changed in wp_posts. But the function does not create a revision copy from the old table item as described in the WP Function Reference.

Here is my code

$upd_post = array();
$upd_post['ID'] = $post->ID;
$upd_post['post_title'] = $wp_query->query_vars['4tn_title'];
$upd_post['post_content'] = $wp_query->query_vars['4tn_content'];
$update_result = wp_update_post( $upd_post );

Perhaps it doesn't work because the post_type is a cutom-type 'portfolio' instead 'post'.

If this is the reason what is to do for getting a 'revisioncopy' for portfolio-items

share|improve this question
add comment

1 Answer

The supports parameter for the post type has to ask for revisions.

Example:

register_post_type( 
    'portfolio', 
    array( 
        'supports' => array ( 'revisions' ) 
    ) 
);
share|improve this answer
    
it works thank you. –  j.oberle Nov 18 '12 at 10:09
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.