Changeset 43442 for branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
- Timestamp:
- 07/13/2018 06:13:27 AM (6 years ago)
- Location:
- branches/4.9
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
-
branches/4.9/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r43438 r43442 1668 1668 1669 1669 if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) { 1670 $revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) ); 1671 $revisions_count = count( $revisions ); 1672 1670 1673 $links['version-history'] = array( 1671 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ), 1672 ); 1674 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ), 1675 'count' => $revisions_count, 1676 ); 1677 1678 if ( $revisions_count > 0 ) { 1679 $last_revision = array_shift( $revisions ); 1680 1681 $links['predecessor-version'] = array( 1682 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $last_revision ), 1683 'id' => $last_revision, 1684 ); 1685 } 1686 1673 1687 } 1674 1688
Note: See TracChangeset
for help on using the changeset viewer.