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.
Built from https://develop.svn.wordpress.org/trunk@26549


git-svn-id: http://core.svn.wordpress.org/trunk@26441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2013-12-03 00:45:10 +00:00
parent a6cabe9f6d
commit 0f20e57329
7 changed files with 12 additions and 12 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 );
}
});

File diff suppressed because one or more lines are too long

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

File diff suppressed because one or more lines are too long

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,

File diff suppressed because one or more lines are too long