Opened 7 years ago
Closed 7 years ago
#45262 closed enhancement (fixed)
Block Editor: Respect AUTOSAVE_INTERVAL value
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.1 | Priority: | normal |
| Severity: | normal | Version: | 5.0 |
| Component: | Editor | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
WordPress specifies the duration after which an autosave should occur in an editing environment via its AUTOSAVE_INTERVAL constant, defaulting to 60 seconds:
In the development of the Gutenberg block editor, a value of 10 seconds was used instead for a more immediate save. This appears to have been persisted over to its merge into core:
For compatibility's sake with the existing constant, should one of the following be considered?
- Change the default value of
AUTOSAVE_INTERVALto 10 seconds or another value (with consideration of impact on dependants, e.g. Customize screen) - Assign the block editor as a factor of the
AUTOSAVE_INTERVAL, e.g.AUTOSAVE_INTERVAL / 6to keep the 10 second duration, assuming an unchanged default - Use the existing default 60 seconds value for the block editor.
Attachments (1)
Change History (11)
#3
@
7 years ago
- Keywords has-patch added
I just went with the simplest approach for now which is to respect whatever value is set in AUTOSAVE_INTERVAL
#5
@
7 years ago
For compatibility's sake with the existing constant, should one of the following be considered?
If necessary, we could add a new filterable wp_get_autosave_interval() function, similar to wp_doing_ajax(), to make tweaking per context easier.
#6
@
7 years ago
For context, my original autosave PR respected AUTOSAVE_INTERVAL, however after this discussion the interval was set back to 10: https://github.com/WordPress/gutenberg/pull/6257/commits/d795e1db8ff040dced0afc6de6baace3521246ec
#7
@
7 years ago
autosave.patch looks good to me and restores the long documented and expected behavior of respecting the AUTOSAVE_INTERVAL constant.
This doesn't seem ready and also not critical.