Contents

Stale-screen notices

If someone else saves a screen you have open, such as Settings, you see a notice asking you to reload, so you do not overwrite their change.

How it works #

A save marks other open copies of a screen stalePerson A saves Settings > General, which moves the screen's revision. Person B has the same screen open; B's tab sends the screen key on Heartbeat, the server answers with the new revision and who made it, and B's screen shows a notice to reload.Person B's tabServerPerson APerson B's tabServerPerson A"A updated this screen 1 minute ago."Reload or DismissSave Settings > GeneralRevision of options/general movesHeartbeat with screen key options/generalNew revision, saved by A

Screen keys #

Screen Key
A Settings page options/general, or the page's option group
A post post/{id}
A user user-edit/{id}
A term term/{taxonomy}/{id}
A comment comment/{id}
A network setting network/settings, or network/site-info/{id} and similar

Another screen gets a key from the wp_presence_current_screen_key filter.

Revisions #

Classic screens that save with a form post and redirect move their revision on save. A screen that saves in the background, over REST or Ajax, moves it with:

wp.presence.markScreenStale( 'options/my-plugin-settings' );

Your own saves never show you a notice, and Dismiss hides it until the next revision. Each key is checked against that screen's own capability, such as manage_options for Settings.

Source: screen-revisions.php ยท stale-screen.js

Check your understanding #

You save Settings in another tab of your own. Do you see the notice?

No. Your own saves move the screen's baseline without a notice.

Edit this page on GitHub