diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php
index 4cfad6e..41493ed 100644
a
|
b
|
function wp_create_post_autosave( $post_data ) { |
1541 | 1541 | return 0; |
1542 | 1542 | } |
1543 | 1543 | |
| 1544 | /** |
| 1545 | * Fires before an autosave is stored. |
| 1546 | * |
| 1547 | * @since 4.1.0 |
| 1548 | * |
| 1549 | * @param Object $new_autosave Post object - the autosave that is about to be saved. |
| 1550 | */ |
| 1551 | do_action( '_wp_creating_autosave', $new_autosave ); |
| 1552 | |
1544 | 1553 | return wp_update_post( $new_autosave ); |
1545 | 1554 | } |
1546 | 1555 | |
diff --git a/src/wp-admin/includes/revision.php b/src/wp-admin/includes/revision.php
index 151cd64..feffdb7 100644
a
|
b
|
function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) { |
92 | 92 | ); |
93 | 93 | } |
94 | 94 | } |
95 | | return $return; |
| 95 | |
| 96 | /** |
| 97 | * Filter the fields displayed in the revision diff UI |
| 98 | * |
| 99 | * @since 4.1.0 |
| 100 | * |
| 101 | * @param array $return Revision UI fields. Each item is an array of id, name and diff. |
| 102 | * @param WP_POST $compare_from The revision post object to compare from. |
| 103 | * @param WP_Post $compare_to The revision post object to compare to. |
| 104 | */ |
| 105 | return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to ); |
| 106 | |
96 | 107 | } |
97 | 108 | |
98 | 109 | /** |
diff --git a/src/wp-includes/revision.php b/src/wp-includes/revision.php
index 45e436f..59aff6c 100644
a
|
b
|
function wp_save_post_revision( $post_id ) { |
133 | 133 | break; |
134 | 134 | } |
135 | 135 | } |
| 136 | |
| 137 | /** |
| 138 | * Filter whether a post has changed. |
| 139 | * |
| 140 | * By default a revision is saved only if one of the revisioned fields has changed. |
| 141 | * This filter allows for additional checks to determine if there were changes. |
| 142 | * |
| 143 | * @since 4.1.0 |
| 144 | * |
| 145 | * @param bool $post_has_changed Whether the post has changed. |
| 146 | * @param int $last_revision ID of the last revision. |
| 147 | * @param int $post Post ID. |
| 148 | * |
| 149 | */ |
| 150 | $post_has_changed = (bool) apply_filters( 'wp_save_post_revision_additional_check_for_changes', $post_has_changed, $last_revision, $post ); |
| 151 | |
136 | 152 | //don't save revision if post unchanged |
137 | | if( ! $post_has_changed ) |
| 153 | if( ! $post_has_changed ) { |
138 | 154 | return; |
| 155 | } |
139 | 156 | } |
140 | 157 | } |
141 | 158 | |