Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter keywordadtd

    (@keywordadtd)

    @specialk

    Thank you for your willingness to help investigate the issue I’ve been experiencing. I truly appreciate your support in resolving this matter. Here’s a summary of the situation and the steps I’ve taken:

    I encountered an issue where changing the Heartbeat interval was not functioning as expected after disabling the Gutenberg editor. To give you some context, I used the following line of code in my pure WordPress setup:

    add_filter('use_block_editor_for_post', '__return_false'); However, following this action, I noticed that attempting to modify the Heartbeat interval was not taking effect.

    Temporary Solution: As a temporary workaround, I’ve managed to find a solution by adding a script in my child theme’s functions.php file. This script enqueues a custom JavaScript file and adjusts the Heartbeat interval for edit pages of all post types. Here’s the script I’m using:

    function enqueue_custom_heartbeat_script() { if (is_admin()) { wp_enqueue_script('custom-heartbeat', get_stylesheet_directory_uri() . '/js/custom-heartbeat.js', array('jquery'), null, true); } } add_action('admin_enqueue_scripts', 'enqueue_custom_heartbeat_script');

    The custom-heartbeat.js file contains:

    jQuery(document).ready(function($) { // Change the Heartbeat interval to 60 seconds (1 minute) wp.heartbeat.interval(60); });

    I hope this information helps provide a clearer picture of the situation. Your guidance in resolving this matter would be immensely appreciated. Once again, thank you for your assistance and support.

    Best regards

Viewing 1 replies (of 1 total)