Definition:
function wp_get_post_revisions( $post_id = 0, $args = null ) {}
Returns all revisions of specified post.
Parameters
- int|object $post_id: Post ID or post object
- $args
Return values
returns:empty if no revisions
Source code
function wp_get_post_revisions( $post_id = 0, $args = null ) {
if ( ! WP_POST_REVISIONS )
return array();
if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) )
return array();
$defaults = array( 'order' => 'DESC', 'orderby' => 'date' );
$args = wp_parse_args( $args, $defaults );
$args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
if ( !$revisions = get_children( $args ) )
return array();
return $revisions;
}
3735

February 12, 2011 


No comments yet... Be the first to leave a reply!