Default settings for heartbeat.
Description
Outputs the nonce used in the heartbeat XHR.
Parameters
$settings
arrayrequired
Source
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;
}
Changelog
Version | Description |
---|---|
3.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.