• Resolved minomet

    (@minomet)


    Hi, the plugin is great.

    How i could reset all the statics, from vendors, to clean the dashboard an restore to 0 the monts earnings?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author WebWizards

    (@webwizardsdev)

    Hi there,
    I believe you can achieve that by adding the following PHP code snippet to your site:

    add_action('wp_footer', function(){
    	$earnings = get_posts( array( 
    	    'post_type' => 'marketking_earning',
    	    'numberposts' => -1,
    	    'post_status'    => 'any',
    	    'fields'    => 'ids',
    	));
    
    	foreach ($earnings as $earning){
    		wp_delete_post($earning);
    	}
    
    	$agents = get_users(array(
    	    'meta_key'     => 'marketking_group',
    	    'meta_value'   => 'none',
    	    'meta_compare' => '!=',
    	    'fields' => 'ids',
    	));
    
    	foreach ($agents as $agent){
    		delete_user_meta($agent,'marketking_user_payout_history');
    		delete_user_meta($agent,'marketking_outstanding_earnings');
    		delete_user_meta($agent,'marketking_user_balance_history');
    	}
    });

    After adding this, open your site on the frontend, for the snippet to load. Then when you’re done, remove the snippet.

    The snippet can be added to functions.php or through any snippets plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘Reset statics / logs’ is closed to new replies.