Merge pull request #626 from GeertDD/filter_address_replacements

Added filter: woocommerce_formatted_address_replacements
This commit is contained in:
Mike Jolley 2012-02-13 11:49:44 -08:00
commit 74aeb5c635
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; $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 );