Commit d37a3d14 authored by Canek Peláez's avatar Canek Peláez
Browse files

Do not ask for statistics on previews.

parent 23059225
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ add_filter('the_content', 'ga_page_stats_content_filter');
function ga_page_stats_content_filter($content) {
    $ga_options = get_option('ga_page_stats_options');
    if (!$ga_options['show_default'] || !is_singular() ||
        !current_user_can('administrator'))
        is_preview() || !current_user_can('administrator'))
        return $content;
    $r = GAPageStats::getPageStats($_SERVER['REQUEST_URI']);
    $page_views = number_format($r['pageViews']);