Revisions: UI Update.

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

See #23497 props adamsilverstein


git-svn-id: https://develop.svn.wordpress.org/trunk@23769 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2013-03-21 15:54:11 +00:00
parent b15ab88b39
commit ae03f1a0b6
9 changed files with 835 additions and 282 deletions
+26
View File
@@ -404,3 +404,29 @@ function _show_post_preview() {
add_filter('the_preview', '_set_preview');
}
}
/**
* Determines if the specified post's most recent revision matches the post (by checking post_modified).
*
* @package WordPress
* @subpackage Post_Revisions
* @since 3.6.0
*
* @param int|object $post Post ID or post object.
* @return bool false if not a match, otherwise true.
*/
function wp_first_revision_matches_current_version( $post ) {
if ( ! $post = get_post( $post ) )
return false;
if ( ! $revisions = wp_get_post_revisions( $post->ID ) )
return false;
$last_revision = array_shift( $revisions );
if ( ! ($last_revision->post_modified == $post->post_modified ) )
return false;
return true;
}