WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Shortcode_My_Account::edit_address() WC 1.0

Edit address page.

Это метод класса: WC_Shortcode_My_Account

Возвращает

Null. Ничего.

Использование

$var = WC_Shortcode_My_Account::edit_address( $load_address );
$load_address(строка)
Type of address to load.
По умолчанию: 'billing'

Код WC Shortcode My Account::edit address: woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php WC 4.3.0

<?php
public static function edit_address( $load_address = 'billing' ) {
	$current_user = wp_get_current_user();
	$load_address = sanitize_key( $load_address );
	$country      = get_user_meta( get_current_user_id(), $load_address . '_country', true );

	if ( ! $country ) {
		$country = WC()->countries->get_base_country();
	}

	if ( 'billing' === $load_address ) {
		$allowed_countries = WC()->countries->get_allowed_countries();

		if ( ! array_key_exists( $country, $allowed_countries ) ) {
			$country = current( array_keys( $allowed_countries ) );
		}
	}

	if ( 'shipping' === $load_address ) {
		$allowed_countries = WC()->countries->get_shipping_countries();

		if ( ! array_key_exists( $country, $allowed_countries ) ) {
			$country = current( array_keys( $allowed_countries ) );
		}
	}

	$address = WC()->countries->get_address_fields( $country, $load_address . '_' );

	// Enqueue scripts.
	wp_enqueue_script( 'wc-country-select' );
	wp_enqueue_script( 'wc-address-i18n' );

	// Prepare values.
	foreach ( $address as $key => $field ) {

		$value = get_user_meta( get_current_user_id(), $key, true );

		if ( ! $value ) {
			switch ( $key ) {
				case 'billing_email':
				case 'shipping_email':
					$value = $current_user->user_email;
					break;
			}
		}

		$address[ $key ]['value'] = apply_filters( 'woocommerce_my_account_edit_address_field_value', $value, $key, $load_address );
	}

	wc_get_template(
		'myaccount/form-edit-address.php',
		array(
			'load_address' => $load_address,
			'address'      => apply_filters( 'woocommerce_address_to_edit', $address, $load_address ),
		)
	);
}