continue;
return $revision;
- break;
}
}
if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
- $post_id = $post['ID'];
$post = _wp_post_revision_fields( $post, $autosave );
$post = wp_slash($post); //since data is from db
*
* @uses get_children()
*
- * @param int|object $post_id Post ID or post object
+ * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post.
* @return array An array of revisions, or an empty array if none.
*/
function wp_get_post_revisions( $post_id = 0, $args = null ) {
if ( ! $post || empty( $post->ID ) )
return array();
- $defaults = array( 'order' => 'DESC', 'orderby' => 'date', 'check_enabled' => true );
+ $defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true );
$args = wp_parse_args( $args, $defaults );
if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) )