How can check if heartbeat is disabled?

I want a code to check if the heartbeat is disabled from a WordPress site or not.

Topic heartbeat-api Wordpress

Category Web


The heartbeat API is essentially a script that is included in your site's head. It performs calls back to the server. So, to disable the heartbeat the script must not be enqueued. And you can check whether a script is enqueued with wp_script_is. Like this:

if (wp_script_is ('heartbeat')) ...

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.