How is $current_page passed in woocommerce_account_orders function?
The woocommerce function woocommerce_account_orders($current_page) has 1 parameter called $current_page. The function is called via woocommerce_account_orders_endpoint via the following hook – add_action( 'woocommerce_account_orders_endpoint', 'woocommerce_account_orders' );