Make WordPress Core


Ignore:
Timestamp:
07/25/2022 07:18:41 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Revisions: Rename the function for retrieving the latest revision ID and total count.

The new name is wp_get_latest_revision_id_and_total_count().

This aims to reduce ambiguity about what exactly is the "first" or "last" revision, and bring more consistency with similar wording elsewhere in core, e.g. latest posts, latest comments, etc.

Follow-up to [53759], [53769].

Props peterwilsoncc.
See #55857.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/revision.php

    r53770 r53778  
    535535 * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
    536536 * @return WP_Error|array {
    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.
     537 *     Returns associative array with latest revision ID and total count.
     538 *
     539 *     @type int $revision The latest revision post ID or 0 if no revisions exist.
    540540 *     @type int $count    The total count of revisions for the given post.
    541541 * }
    542542 */
    543 function wp_get_last_revision_id_and_total_count( $post = 0 ) {
     543function wp_get_latest_revision_id_and_total_count( $post = 0 ) {
    544544    $post = get_post( $post );
    545545
Note: See TracChangeset for help on using the changeset viewer.