wp_heartbeat_settings( array $settings )

Default settings for heartbeat


Description Description

Outputs the nonce used in the heartbeat XHR


Parameters Parameters

$settings

(array) (Required)


Top ↑

Return Return

(array) $settings


Top ↑

Source Source

File: wp-includes/general-template.php

function wp_heartbeat_settings( $settings ) {
	if ( ! is_admin() ) {
		$settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' );
	}

	if ( is_user_logged_in() ) {
		$settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );
	}

	return $settings;
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.6.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.