From 9740fc22b399b97a5bba4c378a747f697447a8e5 Mon Sep 17 00:00:00 2001 From: Dreb Bits Date: Thu, 11 Aug 2016 14:57:41 +0700 Subject: [PATCH 1/3] Add path variable and filter to setup custom path --- chartbeat.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chartbeat.php b/chartbeat.php index 6130256..71bdccb 100644 --- a/chartbeat.php +++ b/chartbeat.php @@ -297,6 +297,9 @@ function chartbeat_configs() { else $cb_configs['use_canonical'] = 'false'; + // Setup custom 'path' + $cb_configs['path'] = apply_filters( 'chartbeat_config_path', false ); + return $cb_configs; } @@ -314,6 +317,9 @@ function add_chartbeat_config(){ _sf_async_config.domain = ""; _sf_async_config.useCanonical = ; + _sf_async_config.path = ''; + _sf_async_config.authors = ""; From 54f47db1e20bc47b28e9dec3cd5286d046d47dbc Mon Sep 17 00:00:00 2001 From: Dreb Bits Date: Thu, 11 Aug 2016 14:59:35 +0700 Subject: [PATCH 2/3] Return nothing if visitor is admin AND tracking is off --- chartbeat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chartbeat.php b/chartbeat.php index 71bdccb..67c2d71 100644 --- a/chartbeat.php +++ b/chartbeat.php @@ -334,7 +334,7 @@ function add_chartbeat_footer() { // if visitor is admin AND tracking is off, do not load chartbeat if ( current_user_can( 'manage_options') && get_option('chartbeat_trackadmins') == 0) - return $analytics ; + return; ?>