// Ensure an include parameter is set in case the orderby is set to 'include'.
if ( !
empty( $request['orderby'
] ) && 'include' ===
$request['orderby'
] &&
empty( $request['include'
] ) ) { return new WP_Error( 'rest_orderby_include_missing_include',
__( 'You need to define an include parameter to order by include.'
),
array
( 'status' => 400
) );
} if ( wp_revisions_enabled( $parent ) ) { $registered =
$this->
get_collection_params();
$args = array
( 'post_parent' =>
$parent->ID,
'post_type' => 'revision',
'post_status' => 'inherit',
'posts_per_page' => -1,
'orderby' => 'date ID',
'order' => 'DESC',
'suppress_filters' => true,
);