Merge pull request #626 from GeertDD/filter_address_replacements
Added filter: woocommerce_formatted_address_replacements
This commit is contained in:
commit
74aeb5c635
|
@ -602,7 +602,7 @@ class WC_Countries {
|
||||||
$full_state = ($country && $state && isset($this->states[$country][$state])) ? $this->states[$country][$state] : $state;
|
$full_state = ($country && $state && isset($this->states[$country][$state])) ? $this->states[$country][$state] : $state;
|
||||||
|
|
||||||
// Substitute address parts into the string
|
// Substitute address parts into the string
|
||||||
$replace = array(
|
$replace = apply_filters('woocommerce_formatted_address_replacements', array(
|
||||||
'{first_name}' => $first_name,
|
'{first_name}' => $first_name,
|
||||||
'{last_name}' => $last_name,
|
'{last_name}' => $last_name,
|
||||||
'{name}' => $first_name . ' ' . $last_name,
|
'{name}' => $first_name . ' ' . $last_name,
|
||||||
|
@ -623,7 +623,7 @@ class WC_Countries {
|
||||||
'{state_upper}' => strtoupper($full_state),
|
'{state_upper}' => strtoupper($full_state),
|
||||||
'{postcode_upper}' => strtoupper($postcode),
|
'{postcode_upper}' => strtoupper($postcode),
|
||||||
'{country_upper}' => strtoupper($full_country),
|
'{country_upper}' => strtoupper($full_country),
|
||||||
);
|
));
|
||||||
|
|
||||||
$formatted_address = str_replace( array_keys($replace), $replace, $format );
|
$formatted_address = str_replace( array_keys($replace), $replace, $format );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue