Opened 8 years ago
Closed 8 years ago
#45262 closed enhancement (fixed)
Block Editor: Respect AUTOSAVE_INTERVAL value
| Reported by: | aduth | Owned by: | pento |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.1 |
| Component: | Editor | Version: | 5.0 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | Focuses: |
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
@
8 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
@
8 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
@
8 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
@
8 years ago
autosave.patch looks good to me and restores the long documented and expected behavior of respecting the AUTOSAVE_INTERVAL constant.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This doesn't seem ready and also not critical.