Dev Resources

  • Home
  • Reference
  • BuddyX Theme
  • Functions
  • Hooks
  • Classes
Filter by type:
Search
Browse: Home / Reference / Functions / wc_get_account_formatted_address()

wc_get_account_formatted_address( string $address_type = 'billing', int $customer_id )

Get account formatted address.

Contents

  • Description
    • Parameters
    • Return
    • Source
    • Changelog
  • User Contributed Notes

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.


Top ↑

Return #Return

(string)


Top ↑

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() );

Expand full source code Collapse full source code


Top ↑

Changelog #Changelog

Changelog
Version Description
3.2.0 Introduced.

Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.

Proudly powered by WordPress