- Timestamp:
- 08/05/2022 01:00:57 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r53814 r53841 2065 2065 2066 2066 if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) { 2067 $revision 2068 $revisions_count = ! is_wp_error( $revision ) ? $revision['count'] : 0;2067 $revisions = wp_get_latest_revision_id_and_total_count( $post->ID ); 2068 $revisions_count = ! is_wp_error( $revisions ) ? $revisions['count'] : 0; 2069 2069 2070 2070 $links['version-history'] = array( … … 2074 2074 2075 2075 if ( $revisions_count > 0 ) { 2076 $latest_revision = $revision['revision'];2077 2078 2076 $links['predecessor-version'] = array( 2079 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $ latest_revision),2080 'id' => $ latest_revision,2077 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $revisions['latest_id'] ), 2078 'id' => $revisions['latest_id'], 2081 2079 ); 2082 2080 }
Note: See TracChangeset
for help on using the changeset viewer.