Heartbeat:

- Bring back heartbeat.interval().
- Rename wp_disable_heartbeat_suspend() to wp_heartbeat_set_suspension().
- Rename the option for disabling suspension from options.suspend to options.suspension.
Fixes #25073.

git-svn-id: https://develop.svn.wordpress.org/trunk@26549 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2013-12-03 00:44:22 +00:00
parent 571d574b09
commit 75ac2cf131
4 changed files with 9 additions and 9 deletions

View File

@ -743,13 +743,13 @@ add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
*
* @since 3.8
*/
function wp_disable_heartbeat_suspend( $settings ) {
function wp_heartbeat_set_suspension( $settings ) {
global $pagenow;
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
$settings['suspend'] = 'disable';
$settings['suspension'] = 'disable';
}
return $settings;
}
add_filter( 'heartbeat_settings', 'wp_disable_heartbeat_suspend' );
add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );

View File

@ -352,7 +352,7 @@ $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
}).ready( function() {
// Set the heartbeat interval to 15 sec.
if ( typeof wp !== 'undefined' && wp.heartbeat ) {
wp.heartbeat.setInterval( 15 );
wp.heartbeat.interval( 15 );
}
});

View File

@ -377,7 +377,7 @@ jQuery(document).ready( function($) {
// Set the heartbeat interval to 15 sec. if post lock dialogs are enabled
if ( typeof wp !== 'undefined' && wp.heartbeat && $('#post-lock-dialog').length ) {
wp.heartbeat.setInterval( 15 );
wp.heartbeat.interval( 15 );
}
// multi-taxonomies

View File

@ -132,7 +132,7 @@
settings.screenId = options.screenId || 'front';
}
if ( options.suspend === 'disable' ) {
if ( options.suspension === 'disable' ) {
settings.suspendEnabled = false;
}
}
@ -342,7 +342,7 @@
// Do this last, can trigger the next XHR if connection time > 5 sec. and newInterval == 'fast'
if ( newInterval ) {
setInterval( newInterval );
interval( newInterval );
}
}).fail( function( jqXHR, textStatus, error ) {
setErrorState( textStatus || 'unknown', jqXHR.status );
@ -605,7 +605,7 @@
* @param string ticks Used with speed = 'fast' or 5, how many ticks before the interval reverts back
* @return int Current interval in seconds
*/
function setInterval( speed, ticks ) {
function interval( speed, ticks ) {
var interval, oldInerval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
if ( speed ) {
@ -725,7 +725,7 @@
hasFocus: hasFocus,
connectNow: connectNow,
disableSuspend: disableSuspend,
setInterval: setInterval,
interval: interval,
hasConnectionError: hasConnectionError,
enqueue: enqueue,
dequeue: dequeue,