• Resolved werdpres

    (@werdpres)


    i swore i had this working before but i can’t remember how

    i want statify to ignore the administrator, or better yet, all logged-on users

    what does ‘condition’ need to be?

    add_filter(
        'statify__skip_tracking',
        function() {
            if ( condition ) {
                return true;
            }
    
            return false;
        }
    );
Viewing 4 replies - 1 through 4 (of 4 total)
  • add_filter(
        'statify__skip_tracking',
        function() {
            if ( is_user_logged_in() ) {
                return true;
            }
    
            return false;
        }
    );

    is_user_logged_in() checks if the user is logged in.

    Thread Starter werdpres

    (@werdpres)

    thank you!

    Plugin Author Patrick Robrecht

    (@patrickrobrecht)

    Dear werdpres,

    please note that Statify ignores all views by logged-in users by default and some other views (see https://www.ads-software.com/plugins/statify/, FAQ 1). If that’s what you want, there’s no need to change the default behavior using the statify__skip_tracking filter.

    Using the code above provided by kittmedia will change the default behavior regarding the tracking of the other views skipped by default (e. g. search result pages).

    Regards
    Patrick

    Thread Starter werdpres

    (@werdpres)

    thank you Patrick – i knew i was ignoring logged-on users before (previous host), i just couldn’t remember how i did it … the answer of course is i didn’t have to do anything ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘ignore logged-in user’ is closed to new replies.