Changeset 23929 for trunk/wp-includes/revision.php
- Timestamp:
- 04/06/2013 11:43:05 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/revision.php
r23928 r23929 587 587 588 588 /** 589 * Upgrade the data589 * Upgrade the revisions author, add the current post as a revision and set the revisions version to 1 590 590 * 591 591 * @package WordPress … … 593 593 * @since 3.6.0 594 594 * 595 * @uses get_post()596 * @uses post_type_supports()597 595 * @uses wp_get_post_revisions() 598 596 * 599 * @param int|object $post_id Post ID or post object 600 * @return true if success, false if problems 601 */ 602 function _wp_upgrade_revisions_of_post( $post ) { 597 * @param object $post Post object 598 * @param array $revisions Current revisions of the post 599 * @return bool true if the revisions were upgraded, false if problems 600 */ 601 function _wp_upgrade_revisions_of_post( $post, $revisions ) { 603 602 global $wpdb; 604 605 $post = get_post( $post );606 if ( ! $post )607 return false;608 609 if ( ! post_type_supports( $post->post_type, 'revisions' ) )610 return false;611 612 $revisions = wp_get_post_revisions( $post->ID ); // array( 'order' => 'DESC', 'orderby' => 'date' ); // Always work from most recent to oldest613 614 if ( ! $first = reset( $revisions ) )615 return true;616 617 // Check if the revisions have already been updated618 if ( preg_match( '/^\d+-(?:autosave|revision)-v\d+$/', $first->post_name ) )619 return true;620 603 621 604 // Add post option exclusively
Note: See TracChangeset
for help on using the changeset viewer.