| 36 | | // Runs only once |
| | 36 | /** |
| | 37 | * Filter the list of fields saved in post revisions. |
| | 38 | * |
| | 39 | * Included by default: 'post_title', 'post_content' and 'post_excerpt'. |
| | 40 | * |
| | 41 | * Dissalowed: 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', |
| | 42 | * 'comment_count' and 'post_author'. |
| | 43 | * |
| | 44 | * @since 2.5.1 |
| | 45 | * |
| | 46 | * @param array $fields List of fields to revision. Contains 'post_title', 'post_content', |
| | 47 | * and 'post_excerpt' by default. |
| | 48 | * |
| | 49 | */ |
| 102 | | if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) { |
| | 115 | /** |
| | 116 | * Override check for chages in revisioned fields before saving a new revision. |
| | 117 | * |
| | 118 | * By default a revision is saved only if one of the revisioned fields has changed. |
| | 119 | * This filter can override that so a revision is saved even if nothing has changed. |
| | 120 | * |
| | 121 | * @since 3.6.0 |
| | 122 | * |
| | 123 | * @param boolean $check_for_changes Check for changes before saving revision? Default true. |
| | 124 | * Return false to bypass and save a new revision regardless. |
| | 125 | * @param int $last_revision The ID of the last revision. |
| | 126 | * @param int $post The ID of the post being saved as a revision. |
| | 127 | * |
| | 128 | */ |
| | 129 | if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', $check_for_changes = true, $last_revision, $post ) ) { |