Created
December 2, 2019 11:17
-
-
Save andrewlimaza/880db4118d5b40c63dd5cb3b6e617db1 to your computer and use it in GitHub Desktop.
Reset visits, views and logins for Paid Memberships Pro.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add &pmpro_reset_analytics=1 to your WordPress dashboard URL/Paid Memberships Pro reports page. | |
* Add this code to your Code Snippets / Custom Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* You may remove this code from your site when you don't need it any longer. | |
*/ | |
function my_pmpro_reset_visit_data() { | |
if ( isset( $_REQUEST["pmpro_reset_analytics"] ) ) { | |
delete_option( 'pmpro_visits' ); | |
delete_option( 'pmpro_views' ); | |
delete_option( 'pmpro_logins' ); | |
delete_option( '_transient_timeout_pmpro_report_memberships_signups' ); | |
delete_option( '_transient_timeout_pmpro_report_memberships_signups' ); | |
delete_option( '_transient_pmpro_report_memberships_signups' ); | |
} | |
} | |
add_action( 'init', 'my_pmpro_reset_visit_data' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment