WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/06/2013 11:43:05 PM (7 years ago)
Author:
azaozz
Message:

Revisions: move the call to _wp_upgrade_revisions_of_post() to edit-form-advanced.php, in the code block checking whether we should show the revisions postbox. See #16215

File:
1 edited

Legend:

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

    r23928 r23929  
    587587
    588588/**
    589  * Upgrade the data
     589 * Upgrade the revisions author, add the current post as a revision and set the revisions version to 1
    590590 *
    591591 * @package WordPress
     
    593593 * @since 3.6.0
    594594 *
    595  * @uses get_post()
    596  * @uses post_type_supports()
    597595 * @uses wp_get_post_revisions()
    598596 *
    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 */
     601function _wp_upgrade_revisions_of_post( $post, $revisions ) {
    603602    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 oldest
    613 
    614     if ( ! $first = reset( $revisions ) )
    615         return true;
    616 
    617     // Check if the revisions have already been updated
    618     if ( preg_match( '/^\d+-(?:autosave|revision)-v\d+$/', $first->post_name ) )
    619         return true;
    620603
    621604    // Add post option exclusively
Note: See TracChangeset for help on using the changeset viewer.