Skip to content

Commit

Permalink
Run on DOM ready
Browse files Browse the repository at this point in the history
  • Loading branch information
azaozz committed Sep 24, 2024
1 parent 7f4fd30 commit ea734cf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/wp-admin/edit-form-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,14 @@ 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 );
}'
'if ( window.wp && window.wp.domReady ) {
window.wp.domReady( function() {
if ( window.wp.heartbeat ) {
window.wp.heartbeat.interval( 10 );
}
} );
}',
'before'
);

/*
Expand Down

0 comments on commit ea734cf

Please sign in to comment.