Added filter: woocommerce_formatted_address_replacements

This commit is contained in:
Geert De Deckere 2012-02-13 13:13:47 +01:00
parent d54812c415
commit b1b6ff8ff2
1 changed files with 2 additions and 2 deletions

View File

@ -602,7 +602,7 @@ class WC_Countries {
$full_state = ($country && $state && isset($this->states[$country][$state])) ? $this->states[$country][$state] : $state;
// Substitute address parts into the string
$replace = array(
$replace = apply_filters('woocommerce_formatted_address_replacements', array(
'{first_name}' => $first_name,
'{last_name}' => $last_name,
'{name}' => $first_name . ' ' . $last_name,
@ -623,7 +623,7 @@ class WC_Countries {
'{state_upper}' => strtoupper($full_state),
'{postcode_upper}' => strtoupper($postcode),
'{country_upper}' => strtoupper($full_country),
);
));
$formatted_address = str_replace( array_keys($replace), $replace, $format );