WordPress.org

Make WordPress Core

Changeset 34925


Ignore:
Timestamp:
10/08/2015 01:03:39 AM (4 years ago)
Author:
johnbillion
Message:

Revert [34917] until the broken test is fixed.

See #13382

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r34917 r34925  
    198198// Detect if there exists an autosave newer than the post and if that autosave is different than the post
    199199if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
    200     foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
     200    foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
    201201        if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
    202202            $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
  • trunk/src/wp-admin/includes/post.php

    r34917 r34925  
    16571657        $post = get_post( $post_id );
    16581658        $autosave_is_different = false;
    1659         foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
     1659        foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields() ) ) as $field ) {
    16601660            if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
    16611661                $autosave_is_different = true;
  • trunk/src/wp-admin/includes/revision.php

    r34917 r34925  
    5555    $return = array();
    5656
    57     foreach ( _wp_post_revision_fields( $post ) as $field => $name ) {
     57    foreach ( _wp_post_revision_fields() as $field => $name ) {
    5858        /**
    5959         * Contextually filter a post revision field.
  • trunk/src/wp-includes/revision.php

    r34917 r34925  
    1515 *
    1616 * @since 2.6.0
    17  * @since 4.4.0 A `WP_Post` object can now be passed to the `$post` parameter.
    1817 * @access private
    1918 *
    2019 * @staticvar array $fields
    2120 *
    22  * @param array|WP_Post $post     Optional. A post array, or a WP_Post object to be processed for insertion as a post revision.
    23  * @param bool          $autosave Optional. Is the revision an autosave? Default false.
     21 * @param array $post     Optional. A post array to be processed for insertion as a post revision.
     22 * @param bool  $autosave Optional. Is the revision an autosave?
    2423 * @return array Post array ready to be inserted as a post revision or array of fields that can be versioned.
    2524 */
    2625function _wp_post_revision_fields( $post = null, $autosave = false ) {
    2726    static $fields = null;
    28 
    29     if ( is_object( $post ) ) {
    30         $post = get_post( $post, ARRAY_A );
    31     }
    3227
    3328    if ( is_null( $fields ) ) {
     
    4944         *
    5045         * @since 2.6.0
    51          * @since 4.4.0 The `$post` parameter was added.
    5246         *
    5347         * @param array $fields List of fields to revision. Contains 'post_title',
    5448         *                      'post_content', and 'post_excerpt' by default.
    55          * @param array $post   A post array being processed for insertion as a post revision.
    5649         */
    57         $fields = apply_filters( '_wp_post_revision_fields', $fields, $post );
     50        $fields = apply_filters( '_wp_post_revision_fields', $fields );
    5851
    5952        // WP uses these internally either in versioning or elsewhere - they cannot be versioned
     
    135128            $post_has_changed = false;
    136129
    137             foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) {
     130            foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
    138131                if ( normalize_whitespace( $post->$field ) != normalize_whitespace( $last_revision->$field ) ) {
    139132                    $post_has_changed = true;
     
    341334
    342335    if ( !is_array( $fields ) )
    343         $fields = array_keys( _wp_post_revision_fields( $revision ) );
     336        $fields = array_keys( _wp_post_revision_fields() );
    344337
    345338    $update = array();
Note: See TracChangeset for help on using the changeset viewer.