[wp-trac] [WordPress Trac] #23216: Create "WP Heartbeat" API

WordPress Trac noreply at wordpress.org
Thu May 30 23:36:53 UTC 2013


#23216: Create "WP Heartbeat" API
----------------------------+------------------
 Reporter:  azaozz          |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  3.6
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  autosave-redo   |
----------------------------+------------------

Comment (by azaozz):

 Replying to [comment:83 alexvorn2]:
 > I think that we can implement an additional feature for receiving data
 from the server as soon as it was modified or updated depending if the
 page was closed or not.

 Not exactly sure what you mean by "if the page was closed or not" but the
 rest is pretty easy to do. After a page loads, we poll the server at a
 regular interval and run couple of filters: if there is any data coming
 from the page, `'heartbeat_received'` so all handlers (callbacks) can get
 data intended for them, then `'heartbeat_send'` so any kind of data can be
 pushed from the server to the current page.

 Have a look at the attached
 [http://core.trac.wordpress.org/attachment/ticket/23216/heartbeat-test-
 plugin.php test plugin] for an example. You can do pretty much anything in
 a function similar to heartbeat_test_comments_count() and have some JS on
 the page to receive the result and do something.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/23216#comment:85>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list