wc_get_account_formatted_address( string $address_type = 'billing', int $customer_id )
Get account formatted address.
Description Description
Parameters Parameters
- $address_type
-
(Optional) Address type. Accepts: 'billing' or 'shipping'. Default to 'billing'.
Default value: 'billing'
- $customer_id
-
(Required) Customer ID. Default to 0.
Return Return
(string)
Source Source
File: includes/wc-account-functions.php
/** * Returns an array of a user's saved payments list for output on the account tab. * * @since 2.6 * @param array $list List of payment methods passed from wc_get_customer_saved_methods_list(). * @param int $customer_id The customer to fetch payment methods for. * @return array Filtered list of customers payment methods. */ function wc_get_account_saved_payment_methods_list( $list, $customer_id ) { $payment_tokens = WC_Payment_Tokens::get_customer_tokens( $customer_id ); foreach ( $payment_tokens as $payment_token ) { $delete_url = wc_get_endpoint_url( 'delete-payment-method', $payment_token->get_id() ); $delete_url = wp_nonce_url( $delete_url, 'delete-payment-method-' . $payment_token->get_id() ); $set_default_url = wc_get_endpoint_url( 'set-default-payment-method', $payment_token->get_id() ); $set_default_url = wp_nonce_url( $set_default_url, 'set-default-payment-method-' . $payment_token->get_id() );
Changelog Changelog
Version | Description |
---|---|
3.2.0 | Introduced. |