mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-15 23:25:50 +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
|
||||
*/
|
||||
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' );
|
||||
|
@ -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 );
|
||||
}
|
||||
});
|
||||
|
||||
|
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
|
||||
if ( typeof wp !== 'undefined' && wp.heartbeat && $('#post-lock-dialog').length ) {
|
||||
wp.heartbeat.setInterval( 15 );
|
||||
wp.heartbeat.interval( 15 );
|
||||
}
|
||||
|
||||
// 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';
|
||||
}
|
||||
|
||||
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,
|
||||
|
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