Skip to Content
Menu

full_address()

Get the full address from Nebula Options.

PHP September 15, 2023

Usage

PHP
nebula()->full_address($encoded)

Parameters

$encoded
(Optional) (Boolean) Whether to return encoded
Default: false

Request or provide clarification »

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.

Was this page helpful? Yes No


    A feedback message is required to submit this form.


    Please check that you have entered a valid email address.

    Enter your email address if you would like a response.

    Thank you for your feedback!

    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?