Refresh nonces with heartbeat responses#677
Conversation
This sets the table for exporting the Fieldmanager context to `window.fm`.
|
Hey @dlh01, |
|
Thanks @mslinnea! As we discussed outside of GitHub, the source of the failing nonce appears to be WordPress core (and we'll work on filing a Trac ticket for it soon). I checked the Would you mind giving the PR a formal 👍 if everything else seems OK? |
See #627.
The implementation in this PR makes a filter for
wp_refresh_noncesavailable to all contexts by placing it on the baseFieldmanager_Contextclass. However, to add the filter, custom contexts would need to add calls toparent::__construct()or calladd_filter()manually.It also appears that core does not refresh its own nonces on heartbeat requests outside of the edit-post screen. For example, unless I was doing something wrong, if you mimic the steps in #627 on an edit-term screen, attempting to save the term after reauthenticating will still fail. See https://core.trac.wordpress.org/ticket/29312.