Changeset 53779 for trunk/src/wp-includes/revision.php
- Timestamp:
- 07/25/2022 07:28:29 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/revision.php
r53778 r53779 137 137 $revisions = wp_get_post_revisions( $post_id ); 138 138 if ( $revisions ) { 139 // Grab the la st revision, but not an autosave.139 // Grab the latest revision, but not an autosave. 140 140 foreach ( $revisions as $revision ) { 141 141 if ( false !== strpos( $revision->post_name, "{$revision->post_parent}-revision" ) ) { 142 $la st_revision = $revision;142 $latest_revision = $revision; 143 143 break; 144 144 } … … 146 146 147 147 /** 148 * Filters whether the post has changed since the la st revision.148 * Filters whether the post has changed since the latest revision. 149 149 * 150 150 * By default a revision is saved only if one of the revisioned fields has changed. … … 155 155 * @param bool $check_for_changes Whether to check for changes before saving a new revision. 156 156 * Default true. 157 * @param WP_Post $la st_revision The last revision post object.157 * @param WP_Post $latest_revision The latest revision post object. 158 158 * @param WP_Post $post The post object. 159 159 */ 160 if ( isset( $la st_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) {160 if ( isset( $latest_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $latest_revision, $post ) ) { 161 161 $post_has_changed = false; 162 162 163 163 foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) { 164 if ( normalize_whitespace( $post->$field ) !== normalize_whitespace( $la st_revision->$field ) ) {164 if ( normalize_whitespace( $post->$field ) !== normalize_whitespace( $latest_revision->$field ) ) { 165 165 $post_has_changed = true; 166 166 break; … … 177 177 * 178 178 * @param bool $post_has_changed Whether the post has changed. 179 * @param WP_Post $la st_revision The last revision post object.179 * @param WP_Post $latest_revision The latest revision post object. 180 180 * @param WP_Post $post The post object. 181 181 */ 182 $post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $la st_revision, $post );182 $post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $latest_revision, $post ); 183 183 184 184 // Don't save revision if post unchanged.
Note: See TracChangeset
for help on using the changeset viewer.