Changeset 34925 for trunk/src/wp-includes/revision.php
- Timestamp:
- 10/08/2015 01:03:39 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/revision.php
r34917 r34925 15 15 * 16 16 * @since 2.6.0 17 * @since 4.4.0 A `WP_Post` object can now be passed to the `$post` parameter.18 17 * @access private 19 18 * 20 19 * @staticvar array $fields 21 20 * 22 * @param array |WP_Post $post Optional. A post array, or a WP_Post objectto 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? 24 23 * @return array Post array ready to be inserted as a post revision or array of fields that can be versioned. 25 24 */ 26 25 function _wp_post_revision_fields( $post = null, $autosave = false ) { 27 26 static $fields = null; 28 29 if ( is_object( $post ) ) {30 $post = get_post( $post, ARRAY_A );31 }32 27 33 28 if ( is_null( $fields ) ) { … … 49 44 * 50 45 * @since 2.6.0 51 * @since 4.4.0 The `$post` parameter was added.52 46 * 53 47 * @param array $fields List of fields to revision. Contains 'post_title', 54 48 * 'post_content', and 'post_excerpt' by default. 55 * @param array $post A post array being processed for insertion as a post revision.56 49 */ 57 $fields = apply_filters( '_wp_post_revision_fields', $fields , $post);50 $fields = apply_filters( '_wp_post_revision_fields', $fields ); 58 51 59 52 // WP uses these internally either in versioning or elsewhere - they cannot be versioned … … 135 128 $post_has_changed = false; 136 129 137 foreach ( array_keys( _wp_post_revision_fields( $post) ) as $field ) {130 foreach ( array_keys( _wp_post_revision_fields() ) as $field ) { 138 131 if ( normalize_whitespace( $post->$field ) != normalize_whitespace( $last_revision->$field ) ) { 139 132 $post_has_changed = true; … … 341 334 342 335 if ( !is_array( $fields ) ) 343 $fields = array_keys( _wp_post_revision_fields( $revision) );336 $fields = array_keys( _wp_post_revision_fields() ); 344 337 345 338 $update = array();
Note: See TracChangeset
for help on using the changeset viewer.