mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
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:
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user