- Timestamp:
- 07/13/2018 04:06:23 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r43437 r43439 1676 1676 1677 1677 if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) { 1678 $revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) ); 1679 $revisions_count = count( $revisions ); 1680 1678 1681 $links['version-history'] = array( 1679 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ), 1680 ); 1682 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ), 1683 'count' => $revisions_count, 1684 ); 1685 1686 if ( $revisions_count > 0 ) { 1687 $last_revision = array_shift( $revisions ); 1688 1689 $links['predecessor-version'] = array( 1690 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $last_revision ), 1691 'id' => $last_revision, 1692 ); 1693 } 1694 1681 1695 } 1682 1696
Note: See TracChangeset
for help on using the changeset viewer.