Revert [34917] until the broken test is fixed.

See #13382

Built from https://develop.svn.wordpress.org/trunk@34925


git-svn-id: http://core.svn.wordpress.org/trunk@34890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2015-10-08 01:04:25 +00:00
parent bb8ba86ed1
commit 0e1ecdcbf3
5 changed files with 9 additions and 16 deletions

View File

@ -197,7 +197,7 @@ $form_extra .= "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_
// Detect if there exists an autosave newer than the post and if that autosave is different than the post // Detect if there exists an autosave newer than the post and if that autosave is different than the post
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) { if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) { foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) { if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
$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 ) ); $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 ) );
break; break;

View File

@ -1656,7 +1656,7 @@ function wp_create_post_autosave( $post_data ) {
// If the new autosave has the same content as the post, delete the autosave. // If the new autosave has the same content as the post, delete the autosave.
$post = get_post( $post_id ); $post = get_post( $post_id );
$autosave_is_different = false; $autosave_is_different = false;
foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) { foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields() ) ) as $field ) {
if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) { if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
$autosave_is_different = true; $autosave_is_different = true;
break; break;

View File

@ -54,7 +54,7 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
$return = array(); $return = array();
foreach ( _wp_post_revision_fields( $post ) as $field => $name ) { foreach ( _wp_post_revision_fields() as $field => $name ) {
/** /**
* Contextually filter a post revision field. * Contextually filter a post revision field.
* *

View File

@ -14,22 +14,17 @@
* an array whose keys are the post fields to be saved for post revisions. * an array whose keys are the post fields to be saved for post revisions.
* *
* @since 2.6.0 * @since 2.6.0
* @since 4.4.0 A `WP_Post` object can now be passed to the `$post` parameter.
* @access private * @access private
* *
* @staticvar array $fields * @staticvar array $fields
* *
* @param array|WP_Post $post Optional. A post array, or a WP_Post object to be processed for insertion as a post revision. * @param array $post Optional. A post array to be processed for insertion as a post revision.
* @param bool $autosave Optional. Is the revision an autosave? Default false. * @param bool $autosave Optional. Is the revision an autosave?
* @return array Post array ready to be inserted as a post revision or array of fields that can be versioned. * @return array Post array ready to be inserted as a post revision or array of fields that can be versioned.
*/ */
function _wp_post_revision_fields( $post = null, $autosave = false ) { function _wp_post_revision_fields( $post = null, $autosave = false ) {
static $fields = null; static $fields = null;
if ( is_object( $post ) ) {
$post = get_post( $post, ARRAY_A );
}
if ( is_null( $fields ) ) { if ( is_null( $fields ) ) {
// Allow these to be versioned // Allow these to be versioned
$fields = array( $fields = array(
@ -48,13 +43,11 @@ function _wp_post_revision_fields( $post = null, $autosave = false ) {
* and 'post_author'. * and 'post_author'.
* *
* @since 2.6.0 * @since 2.6.0
* @since 4.4.0 The `$post` parameter was added.
* *
* @param array $fields List of fields to revision. Contains 'post_title', * @param array $fields List of fields to revision. Contains 'post_title',
* 'post_content', and 'post_excerpt' by default. * 'post_content', and 'post_excerpt' by default.
* @param array $post A post array being processed for insertion as a post revision.
*/ */
$fields = apply_filters( '_wp_post_revision_fields', $fields, $post ); $fields = apply_filters( '_wp_post_revision_fields', $fields );
// WP uses these internally either in versioning or elsewhere - they cannot be versioned // WP uses these internally either in versioning or elsewhere - they cannot be versioned
foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect )
@ -134,7 +127,7 @@ function wp_save_post_revision( $post_id ) {
if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', $check_for_changes = true, $last_revision, $post ) ) { if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', $check_for_changes = true, $last_revision, $post ) ) {
$post_has_changed = false; $post_has_changed = false;
foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) { foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
if ( normalize_whitespace( $post->$field ) != normalize_whitespace( $last_revision->$field ) ) { if ( normalize_whitespace( $post->$field ) != normalize_whitespace( $last_revision->$field ) ) {
$post_has_changed = true; $post_has_changed = true;
break; break;
@ -340,7 +333,7 @@ function wp_restore_post_revision( $revision_id, $fields = null ) {
return $revision; return $revision;
if ( !is_array( $fields ) ) if ( !is_array( $fields ) )
$fields = array_keys( _wp_post_revision_fields( $revision ) ); $fields = array_keys( _wp_post_revision_fields() );
$update = array(); $update = array();
foreach ( array_intersect( array_keys( $revision ), $fields ) as $field ) { foreach ( array_intersect( array_keys( $revision ), $fields ) as $field ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.4-alpha-34924'; $wp_version = '4.4-alpha-34925';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.