Changeset 53769 for trunk/src/wp-includes/revision.php
- Timestamp:
- 07/23/2022 03:40:10 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/revision.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/revision.php
r53759 r53769 529 529 530 530 /** 531 * Get latest revisionand count of revisions for a post.531 * Returns the latest revision ID and count of revisions for a post. 532 532 * 533 533 * @since 6.1.0 534 534 * 535 * @param int|WP_Post |null$post Optional. Post ID or WP_Post object. Default is global $post.535 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post. 536 536 * @return WP_Error|array { 537 * Returns associative array with last revision and total count.538 * 539 * @type int $revision The last revision post id or 0 if non existing.540 * @type int $count The total count of revisions for $post_id.537 * Returns associative array with last revision ID and total count. 538 * 539 * @type int $revision The last revision post ID or 0 if no revisions exist. 540 * @type int $count The total count of revisions for the given post. 541 541 * } 542 542 */ 543 function wp_get_last est_revision_id_and_total_count( $post = null) {543 function wp_get_last_revision_id_and_total_count( $post = 0 ) { 544 544 $post = get_post( $post ); 545 545 546 546 if ( ! $post ) { 547 return new WP_Error( ' revision_error', __( 'Invalid post.' ) );547 return new WP_Error( 'invalid_post', __( 'Invalid post.' ) ); 548 548 } 549 549 550 550 if ( ! wp_revisions_enabled( $post ) ) { 551 return new WP_Error( 'revision _error', __( 'Revisions not enabled.' ) );551 return new WP_Error( 'revisions_not_enabled', __( 'Revisions not enabled.' ) ); 552 552 } 553 553
Note: See TracChangeset
for help on using the changeset viewer.