WC_Countries::__get PHP Метод

__get() публичный Метод

Auto-load in-accessible properties on demand.
public __get ( mixed $key ) : mixed
$key mixed
Результат mixed
    public function __get($key)
    {
        if ('countries' == $key) {
            return $this->get_countries();
        } elseif ('states' == $key) {
            return $this->get_states();
        }
    }

Usage Example

								<label><?php 
echo $zip;
?>
</label>
								<input type="text" name="billing_postcode" id="billing_postcode" value="<?php 
if (isset($customer)) {
    echo $customer['billing_postcode'];
}
?>
" tabindex="1" />
							</div>
							<div class="field_block">
								<?php 
global $woocommerce;
$countries_obj = new WC_Countries();
$countries = $countries_obj->__get('countries');
$default_country = $countries_obj->get_base_country();
$default_county_states = $countries_obj->get_states($default_country);
if (isset($customer['billing_state'])) {
    $default_state = $customer['billing_state'];
} else {
    $default_state = '';
}
woocommerce_form_field('billing_state', array('type' => 'select', 'class' => array('chzn-drop'), 'label' => $state, 'placeholder' => __('Select a State'), 'options' => $default_county_states, 'default' => $default_state));
?>
							</div>
							<div style="clear:both;"></div>
						</div>

						<div class="woocommerce" style="text-align:center;">
							<a class="checkout-button button alt wc-forward" href="#" onclick="jQuery('form.cart').submit();return(false);"><?php