Skip to content

Instantly share code, notes, and snippets.

View RafaelFunchal's full-sized avatar

Rafael Funchal RafaelFunchal

View GitHub Profile
@ideadude
ideadude / my_pmpro_report_login_wp_visits_only_for_users.php
Created February 21, 2020 13:29
Change PMPro to only track visits for logged in users.
/**
* Change PMPro to only track visits for logged in users.
* Add this code into a custom plugin or code snippet.
*/
function my_pmpro_report_login_wp_visits_only_for_users() {
if ( ! is_user_logged_in() ) {
remove_action( 'wp', 'pmpro_report_login_wp_visits' );
}
}
add_action( 'init', 'my_pmpro_report_login_wp_visits_only_for_users' );