mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 07:35:39 +01:00
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:
parent
a6cabe9f6d
commit
0f20e57329
@ -743,13 +743,13 @@ add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
|
|||||||
*
|
*
|
||||||
* @since 3.8
|
* @since 3.8
|
||||||
*/
|
*/
|
||||||
function wp_disable_heartbeat_suspend( $settings ) {
|
function wp_heartbeat_set_suspension( $settings ) {
|
||||||
global $pagenow;
|
global $pagenow;
|
||||||
|
|
||||||
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
|
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
|
||||||
$settings['suspend'] = 'disable';
|
$settings['suspension'] = 'disable';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $settings;
|
return $settings;
|
||||||
}
|
}
|
||||||
add_filter( 'heartbeat_settings', 'wp_disable_heartbeat_suspend' );
|
add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
|
||||||
|
@ -352,7 +352,7 @@ $( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
|
|||||||
}).ready( function() {
|
}).ready( function() {
|
||||||
// Set the heartbeat interval to 15 sec.
|
// Set the heartbeat interval to 15 sec.
|
||||||
if ( typeof wp !== 'undefined' && wp.heartbeat ) {
|
if ( typeof wp !== 'undefined' && wp.heartbeat ) {
|
||||||
wp.heartbeat.setInterval( 15 );
|
wp.heartbeat.interval( 15 );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
2
wp-admin/js/inline-edit-post.min.js
vendored
2
wp-admin/js/inline-edit-post.min.js
vendored
File diff suppressed because one or more lines are too long
@ -377,7 +377,7 @@ jQuery(document).ready( function($) {
|
|||||||
|
|
||||||
// Set the heartbeat interval to 15 sec. if post lock dialogs are enabled
|
// Set the heartbeat interval to 15 sec. if post lock dialogs are enabled
|
||||||
if ( typeof wp !== 'undefined' && wp.heartbeat && $('#post-lock-dialog').length ) {
|
if ( typeof wp !== 'undefined' && wp.heartbeat && $('#post-lock-dialog').length ) {
|
||||||
wp.heartbeat.setInterval( 15 );
|
wp.heartbeat.interval( 15 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// multi-taxonomies
|
// multi-taxonomies
|
||||||
|
2
wp-admin/js/post.min.js
vendored
2
wp-admin/js/post.min.js
vendored
File diff suppressed because one or more lines are too long
@ -132,7 +132,7 @@
|
|||||||
settings.screenId = options.screenId || 'front';
|
settings.screenId = options.screenId || 'front';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( options.suspend === 'disable' ) {
|
if ( options.suspension === 'disable' ) {
|
||||||
settings.suspendEnabled = false;
|
settings.suspendEnabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -342,7 +342,7 @@
|
|||||||
|
|
||||||
// Do this last, can trigger the next XHR if connection time > 5 sec. and newInterval == 'fast'
|
// Do this last, can trigger the next XHR if connection time > 5 sec. and newInterval == 'fast'
|
||||||
if ( newInterval ) {
|
if ( newInterval ) {
|
||||||
setInterval( newInterval );
|
interval( newInterval );
|
||||||
}
|
}
|
||||||
}).fail( function( jqXHR, textStatus, error ) {
|
}).fail( function( jqXHR, textStatus, error ) {
|
||||||
setErrorState( textStatus || 'unknown', jqXHR.status );
|
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
|
* @param string ticks Used with speed = 'fast' or 5, how many ticks before the interval reverts back
|
||||||
* @return int Current interval in seconds
|
* @return int Current interval in seconds
|
||||||
*/
|
*/
|
||||||
function setInterval( speed, ticks ) {
|
function interval( speed, ticks ) {
|
||||||
var interval, oldInerval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
|
var interval, oldInerval = settings.tempInterval ? settings.tempInterval : settings.mainInterval;
|
||||||
|
|
||||||
if ( speed ) {
|
if ( speed ) {
|
||||||
@ -725,7 +725,7 @@
|
|||||||
hasFocus: hasFocus,
|
hasFocus: hasFocus,
|
||||||
connectNow: connectNow,
|
connectNow: connectNow,
|
||||||
disableSuspend: disableSuspend,
|
disableSuspend: disableSuspend,
|
||||||
setInterval: setInterval,
|
interval: interval,
|
||||||
hasConnectionError: hasConnectionError,
|
hasConnectionError: hasConnectionError,
|
||||||
enqueue: enqueue,
|
enqueue: enqueue,
|
||||||
dequeue: dequeue,
|
dequeue: dequeue,
|
||||||
|
2
wp-includes/js/heartbeat.min.js
vendored
2
wp-includes/js/heartbeat.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user