WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #23216, comment 85


Ignore:
Timestamp:
05/30/13 23:53:06 (11 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23216, comment 85

    initial v1  
    55 
    66Have 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. 
     7 
     8Also note that heartbeat won't connect to the server unless there is a script on the page that is expecting a response. This is to limit server load. So for screens where there is no core script using it, you will want to add something with `$(document).on( 'heartbeat-send.my-script', function( e, data ) {...});`.