wp_heartbeat_set_suspension() WordPress Function

The wp_heartbeat_set_suspension() function allows you to temporarily suspend the heartbeat for a specific user. This can be useful if you want to prevent the heartbeat from firing while the user is working on something, to avoid any potential conflicts.

wp_heartbeat_set_suspension( array $settings ) #

Disables suspension of Heartbeat on the Add/Edit Post screens.


Parameters

$settings

(array)(Required)An array of Heartbeat settings.


Top ↑

Return

(array) Filtered Heartbeat settings.


Top ↑

Source

File: wp-admin/includes/misc.php

function wp_heartbeat_set_suspension( $settings ) {
	global $pagenow;

	if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
		$settings['suspension'] = 'disable';
	}

	return $settings;
}

Top ↑

Changelog

Changelog
VersionDescription
3.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.