From b071c28f8b6be06e464ccf582877e66c02859679 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 25 Sep 2024 20:49:21 +0000 Subject: [PATCH] Administration: Fix increasing of the frequency of Heartbeat API requests. Props peterwilsoncc, azaozz. Fixes #61960. git-svn-id: https://develop.svn.wordpress.org/trunk@59092 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index ac097f90b6931..dea530e9fb9f2 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -126,9 +126,10 @@ static function ( $classes ) { // Set Heartbeat interval to 10 seconds, used to refresh post locks. wp_add_inline_script( 'heartbeat', - 'if ( window.wp && window.wp.heartbeat ) { - window.wp.heartbeat.interval( 10 ); - }' + 'jQuery( function() { + wp.heartbeat.interval( 10 ); + } );', + 'after' ); /*