Format an address from address, city, state, zip, country, and phone. Useful for printing out the address on orders, emails, and more.


/**
 * Format an address.
 *
 * @since 1.7.6
 *
 * @see pmpro_formatAddress
 *
 * @param string $address  The formatted address.
 * @param string $name     The name.
 * @param string $address1 The address 1 field.
 * @param string $address2 The address 2 field.
 * @param string $city     The city.
 * @param string $state    The state
 * @param string $zip      The postal code.
 * @param string $country  The country.
 * @param string $phone    The phone number.
 * @param bool   $nl2br    Whether to convert \n to <br> elements.
 *
 * @return string $address The formatted address.
 */
apply_filters( 'pmpro_formatted_address', $address, $name, $address1, $address2, $city, $state, $zip, $country, $phone, $nl2br );

Parameters

$address
string
$name
string
$address1
string
$address2
string
$city
string
$state
string
$zip
string
$country
string
$phone
string
$nl2br
bool

Return Value

$address


Source

File: https://github.com/strangerstudios/paid-memberships-pro/blob/master/includes/functions.php

View in Source Code