WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/21/2013 03:54:11 PM (8 years ago)
Author:
westi
Message:

Revisions: UI Update.

  • Refines the UI to make it clearer and easier to use
  • Introduces weighted tickmarks
  • Fixes comparison bugs.

See #23497 props adamsilverstein

File:
1 edited

Legend:

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

    r23735 r23769  
    405405    }
    406406}
     407
     408/**
     409 * Determines if the specified post's most recent revision matches the post (by checking post_modified).
     410 *
     411 * @package WordPress
     412 * @subpackage Post_Revisions
     413 * @since 3.6.0
     414 *
     415 * @param int|object $post Post ID or post object.
     416 * @return bool false if not a match, otherwise true.
     417 */
     418function wp_first_revision_matches_current_version( $post ) {
     419
     420        if ( ! $post = get_post( $post ) )
     421                return false;
     422
     423        if ( ! $revisions = wp_get_post_revisions( $post->ID ) )
     424                return false;
     425
     426        $last_revision = array_shift( $revisions );
     427
     428        if ( ! ($last_revision->post_modified == $post->post_modified ) )
     429                return false;
     430
     431        return true;
     432}
Note: See TracChangeset for help on using the changeset viewer.