Heartbeat: introduce "suspend" functionality and enable it after 20 min. of inactivity, see #25073.

git-svn-id: https://develop.svn.wordpress.org/trunk@26428 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2013-11-27 01:55:59 +00:00
parent c83ea1d936
commit 3b2dc8f443
2 changed files with 55 additions and 5 deletions

View File

@@ -739,3 +739,19 @@ function wp_refresh_post_nonces( $response, $data, $screen_id ) {
return $response;
}
add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
/**
* Disable suspending of Heartbeat on the Add/Edit Post screens
*
* @since 3.8
*/
function wp_disable_heartbeat_suspend( $settings ) {
global $pagenow;
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
$settings['suspend'] = 'disable';
}
return $settings;
}
add_filter( 'heartbeat_settings', 'wp_disable_heartbeat_suspend' );