Show user’s purchase history as a dashboard widget

By default, when a user registers via the checkout, they are automatically logged in and can access the WordPress’ dashboard as a subscriber. This snippet adds a customer’s purchase history as a dashboard widget. Copy and paste the following functions (mind the opening PHP tag) into your child theme’s functions.php or custom plugin. View the …