Add "experimental" to heartbeat phpdoc, fixes #24855 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@24818 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2013-07-28 20:54:48 +00:00
parent 7eda325f58
commit 50b8437d59
2 changed files with 15 additions and 4 deletions

View File

@ -9,6 +9,12 @@
/*
* No-privilege Ajax handlers.
*/
/**
* Heartbeat API (experimental)
*
* Runs when the user is not logged in.
*/
function wp_ajax_nopriv_heartbeat() {
$response = array();
@ -2052,6 +2058,11 @@ function wp_ajax_send_link_to_editor() {
wp_send_json_success( $html );
}
/**
* Heartbeat API (experimental)
*
* Runs when the user is logged in.
*/
function wp_ajax_heartbeat() {
if ( empty( $_POST['_nonce'] ) )
wp_send_json_error();
@ -2072,9 +2083,6 @@ function wp_ajax_heartbeat() {
if ( ! empty($_POST['data']) ) {
$data = (array) $_POST['data'];
// todo: separate filters: 'heartbeat_[action]' so we call different callbacks only when there is data for them,
// or all callbacks listen to one filter and run when there is something for them in $data?
$response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
}

View File

@ -1,6 +1,10 @@
/**
* Heartbeat API
*
* Note: this API is "experimental" meaning it will likely change a lot
* in the next few releases based on feedback from 3.6.0. If you intend
* to use it, please follow the development closely.
*
* Heartbeat is a simple server polling API that sends XHR requests to
* the server every 15 seconds and triggers events (or callbacks) upon
* receiving data. Currently these 'ticks' handle transports for post locking,
@ -47,7 +51,6 @@ window.wp = window.wp || {};
* Returns a boolean that's indicative of whether or not there is a connection error
*
* @returns boolean
* @private
*/
this.hasConnectionError = function() {
return hasConnectionError;