Switch language

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




wp_get_post_revision [ WordPress Function ]

wp_get_post_revision ( $post, $output = OBJECT, $filter = 'raw' )
Parameters:
  • (int|object) $post Post ID or post object
  • (string) $output Optional. OBJECT, ARRAY_A, or ARRAY_N.
  • (string) $filter Optional sanitation filter. @see sanitize_post()
Uses:
Returns:
  • (mixed) Null if error or post object if success
Defined at:



Gets a post revision.

Source


<?php
function &wp_get_post_revision(&$post$output OBJECT$filter 'raw') {
    
$null null;
    if ( !
$revision get_post$postOBJECT$filter ) )
        return 
$revision;
    if ( 
'revision' !== $revision->post_type )
        return 
$null;

    if ( 
$output == OBJECT ) {
        return 
$revision;
    } elseif ( 
$output == ARRAY_A ) {
        
$_revision get_object_vars($revision);
        return 
$_revision;
    } elseif ( 
$output == ARRAY_N ) {
        
$_revision array_values(get_object_vars($revision));
        return 
$_revision;
    }

    return 
$revision;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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