Usage
PHP
nebula()->full_address($encoded)
Parameters
$encoded
(Optional) (Boolean) Whether to return encoded
Default: false
Examples
Get the individual address components: Street Address
PHP
<?php echo nebula()->get_option('street_address'); ?>
Get the individual address components: City
PHP
<?php echo nebula()->get_option('locality'); ?>
Get the individual address components: State
PHP
<?php echo nebula()->get_option('region'); ?>
Get the individual address components: Zip Code
PHP
<?php echo nebula()->get_option('postal_code'); ?>
Get the individual address components: Country
PHP
<?php echo nebula()->get_option('country_name'); ?>
Additional Notes
This is useful so you don’t need to make multiple calls to nebula()->option() for each address component.
Source File
Located in /libs/Options/Options.php on line 103.
No Hooks
This function does not have any filters or actions available. Request one?
PHP
public function full_address($encoded=false){ $nebula_options = get_option('nebula_options'); if ( !$nebula_options['street_address'] ){ return false; } $full_address = $nebula_options['street_address'] . ', ' . $nebula_options['locality'] . ', ' . $nebula_options['region'] . ' ' . $nebula_options['postal_code']; if ( $encoded ){ $full_address = str_replace(array(', ', ' '), '+', $full_address); } return $full_address; }
Override
This function can not be short-circuited with an override filter. Request one?