Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_create_post_autosave [ WordPress Function ]

wp_create_post_autosave ( $post_id )
Uses:
Returns:
  • (unknown)
Defined at:



Creates autosave data for the specified post from $_POST data.

Source


<?php
function wp_create_post_autosave$post_id ) {
    
$translated _wp_translate_postdatatrue );
    if ( 
is_wp_error$translated ) )
        return 
$translated;

    
// Only store one autosave. If there is already an autosave, overwrite it.
    
if ( $old_autosave wp_get_post_autosave$post_id ) ) {
        
$new_autosave _wp_post_revision_fields$_POSTtrue );
        
$new_autosave['ID'] = $old_autosave->ID;
        
$new_autosave['post_author'] = get_current_user_id();
        return 
wp_update_post$new_autosave );
    }

    
// _wp_put_post_revision() expects unescaped.
    
$_POST stripslashes_deep($_POST);

    
// Otherwise create the new autosave as a special post revision
    
return _wp_put_post_revision$_POSTtrue );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics