Sum the total amount of a specific product purchased per user and display in table

WooCommerce: Get Order info for all users. I was trying to help you get going.. After a while i had a complete solution :S… So here it is, a tested single shortcode that outputs your <table> (WooCommerce 3+ only): add_shortcode(‘user_order_info_table’, ‘sc_user_order_info_table_callback’); function sc_user_order_info_table_callback() { $result_array = array(); $users = get_users(); if($users) { foreach ($users as … Read more

Redirect specific user role to specific site after login?

You should use the filter login_redirect instead of wp_login: function role_user_redirect_login($redirect_to, $request, $user){ if(array_key_exists(‘user’, $user->caps)){ return admin_url(‘edit.php?post_type=test’, ‘https’); } return $redirect_to; } add_filter(‘login_redirect’, ‘role_user_redirect_login’, 10, 3);