wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_get_post_revision › WordPress Function
Since2.6.0
Deprecatedn/a
› wp_get_post_revision ( $post, $output = OBJECT, $filter = 'raw' )
Parameters: (3) |
|
Returns: |
|
Defined at: |
|
Codex: |
Gets a post revision.
Source
function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) { $revision = get_post( $post, OBJECT, $filter ); if ( ! $revision ) { return $revision; } if ( 'revision' !== $revision->post_type ) { return null; } if ( OBJECT === $output ) { return $revision; } elseif ( ARRAY_A === $output ) { $_revision = get_object_vars( $revision ); return $_revision; } elseif ( ARRAY_N === $output ) { $_revision = array_values( get_object_vars( $revision ) ); return $_revision; } return $revision; }