Ticket #44786: autosave-allow-revision.diff
File autosave-allow-revision.diff, 834 bytes (added by , 5 years ago) |
---|
-
src/wp-includes/revision.php
109 109 * @return int|WP_Error|void Void or 0 if error, new revision ID, if success. 110 110 */ 111 111 function wp_save_post_revision( $post_id ) { 112 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { 112 $autosave = defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE; 113 /** 114 * Filters whether saving of revisions is allowed during autosaves. 115 * Normally, it is disallowed whenever the `DOING_AUTOSAVE` constant is truthy. 116 * 117 * @since 5.0.0 118 * 119 * @param bool $allow Is saving of revisions allowed for autosaves. 120 */ 121 if ( $autosave && ! apply_filters( 'allow_revisions_for_autosave', false ) ) { 113 122 return; 114 123 } 115 124