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

WordPress Trac noreply at wordpress.org
Thu May 30 01:42:26 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):

 23216-3.patch changes/adds separator to the var names.

 Thinking more about splitting `heartbeat_received` into separate filters.
 Something like this should work:

 {{{
 if ( ! empty($_POST['data']) ) {
         foreach ( (array) $_POST['data'] as $handle => $value ) {
                 $handle = sanitize_key( $handle );
                 $data = apply_filters( 'heartbeat-' . $handle, null,
 $value, $screen_id );

                 if ( null !== $data )
                         $response[$handle] = $data;
         }
 }
 }}}

 The thing is there are four filters, two in PHP and two in JS. Splitting
 only one of them can make this feel inconsistent.

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


More information about the wp-trac mailing list