woocommerce_formatted_address_replacements хук-фильтрWC 1.0

Substitute address parts into the string.

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

add_filter( 'woocommerce_formatted_address_replacements', 'wp_kama_woocommerce_formatted_address_replacements_filter', 10, 2 );

/**
 * Function for `woocommerce_formatted_address_replacements` filter-hook.
 * 
 * @param  $array 
 * @param  $args  
 *
 * @return 
 */
function wp_kama_woocommerce_formatted_address_replacements_filter( $array, $args ){

	// filter...
	return $array;
}
$array
-
$args
-

Где вызывается хук

WC_Countries::get_formatted_address()
woocommerce_formatted_address_replacements
woocommerce/includes/class-wc-countries.php 600-638
apply_filters(
	'woocommerce_formatted_address_replacements',
	array(
		'{first_name}'       => $args['first_name'],
		'{last_name}'        => $args['last_name'],
		'{name}'             => sprintf(
			/* translators: 1: first name 2: last name */
			_x( '%1$s %2$s', 'full name', 'woocommerce' ),
			$args['first_name'],
			$args['last_name']
		),
		'{company}'          => $args['company'],
		'{address_1}'        => $args['address_1'],
		'{address_2}'        => $args['address_2'],
		'{city}'             => $args['city'],
		'{state}'            => $full_state,
		'{postcode}'         => $args['postcode'],
		'{country}'          => $full_country,
		'{first_name_upper}' => wc_strtoupper( $args['first_name'] ),
		'{last_name_upper}'  => wc_strtoupper( $args['last_name'] ),
		'{name_upper}'       => wc_strtoupper(
			sprintf(
				/* translators: 1: first name 2: last name */
				_x( '%1$s %2$s', 'full name', 'woocommerce' ),
				$args['first_name'],
				$args['last_name']
			)
		),
		'{company_upper}'    => wc_strtoupper( $args['company'] ),
		'{address_1_upper}'  => wc_strtoupper( $args['address_1'] ),
		'{address_2_upper}'  => wc_strtoupper( $args['address_2'] ),
		'{city_upper}'       => wc_strtoupper( $args['city'] ),
		'{state_upper}'      => wc_strtoupper( $full_state ),
		'{state_code}'       => wc_strtoupper( $state ),
		'{postcode_upper}'   => wc_strtoupper( $args['postcode'] ),
		'{country_upper}'    => wc_strtoupper( $full_country ),
	),
	$args
)

Где используется хук в WooCommerce

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