Heartbeat: improve setting the errorstate, add ajaxurl to the settings object when loading on the front-end, some code cleanup, see #23216

git-svn-id: http://core.svn.wordpress.org/trunk@23882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz
2013-03-30 23:32:12 +00:00
parent bdc3e9bdb9
commit 651534f24e
2 changed files with 83 additions and 53 deletions

View File

@@ -2333,6 +2333,9 @@ function __checked_selected_helper( $helper, $current, $echo, $type ) {
* @return array $settings
*/
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' );