- Timestamp:
- 07/22/2022 01:22:04 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r53507 r53759 2025 2025 2026 2026 if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) { 2027 $revision s = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ));2028 $revisions_count = count( $revisions );2027 $revision = wp_get_lastest_revision_id_and_total_count( $post->ID ); 2028 $revisions_count = ! is_wp_error( $revision ) ? $revision['count'] : 0; 2029 2029 2030 2030 $links['version-history'] = array( … … 2034 2034 2035 2035 if ( $revisions_count > 0 ) { 2036 $last_revision = array_shift( $revisions ); 2037 2036 $last_revision = $revision['revision']; 2038 2037 $links['predecessor-version'] = array( 2039 2038 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $last_revision ),
Note: See TracChangeset
for help on using the changeset viewer.