Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Add WooCommerce Orders shortcode */
- function woocommerce_orders() {
- $user_id = get_current_user_id();
- if ($user_id == 0) {
- return do_shortcode('[woocommerce_my_account]');
- }else{
- ob_start();
- wc_get_template( 'myaccount/my-orders.php', array(
- 'current_user' => get_user_by( 'id', $user_id),
- 'order_count' => $order_count
- ) );
- return ob_get_clean();
- }
- }
- add_shortcode('woocommerce_orders', 'woocommerce_orders');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement