问题描述:

I using the wordpress recent copy in my localhost. I saw different features I opened admin pages as different tab in browser. If i logout anyone of the tab all tab get in popup like session expired like that.What my question is there is a hook in wordpress to show this type of popup.

I tried thickbox but it not look this way. Any guidance for the default popup is much

appreciated.

Thanks

网友答案:

That's the new Heartbeat API. That specific pop-up is enqueued here and this is the JS file that opens it.

Nice articles by two heavy-weights (my emphasis):

What Is the Heartbeat API?

The heartbeat API allows for regular communication between the user’s browser and the server. One of the original motivations was to allow for locking posts and warning users when more than one user is attempting to edit a post, or warning the user when their log-in has expired.

Using the WordPress Heartbeat API

WordPress 3.6 introduced a new API called the “WordPress Heartbeat”. This is the API that behind a lot of the improvements in WordPress 3.6, including better revision tracking, user’s session management, and more. I’m going to show you a quick example of how you can use the API to perform “live” actions.

Related posts at Make WordPress Core.

相关阅读:
Top