public/wordpress/wp-content/plugins/wp-courseware/includes/core/countries.php
/**
	 * Outputs the list of countries and states for use in dropdown boxes.
	 *
	 * @since 4.3.0
	 *
	 * @param string $selected_country Selected country.
	 * @param string $selected_state Selected state.
	 * @param bool $escape If should escape HTML.
	 */
Outputs the list of countries and states for use in dropdown boxes.

@param string $selected_country Selected country.
@param string $selected_state Selected state.
@param bool $escape If should escape HTML.
Outputs the list of countries and states for use in dropdown boxes . @param string $selected_country Selected country . @param string $selected_state Selected state . @param bool $escape If should escape HTML .
public function country_dropdown_options( $selected_country = '', $selected_state = '', $escape = false ) {
		if ( $this->countries ) {
			foreach ( $this->countries as $key => $value ) {
				$states = $this->get_states( $key );
				if ( $states ) {
					echo '<optgroup label="' . esc_attr( $value ) . '">';
					foreach ( $states as $state_key => $state_value ) {
						echo '<option value="' . esc_attr( $key ) . ':' . esc_attr( $state_key ) . '"';
						if ( $selected_country === $key && $selected_state === $state_key ) {
							echo ' selected="selected"';
						}
						echo '>' . esc_html( $value ) . ' &mdash; ' . ( $escape ? esc_js( $state_value ) : $state_value ) . '</option>';
					}
					echo '</optgroup>';
				} else {
					echo '<option';
					if ( $selected_country === $key && '*' === $selected_state ) {
						echo ' selected="selected"';
					}
					echo ' value="' . esc_attr( $key ) . '">' . ( $escape ? esc_js( $value ) : $value ) . '</option>';
				}
			}
		}
	}
public function country_dropdown_options ( $ selected_country = '' , $ selected_state = '' , $ escape = false ) { if ( $ this -> countries ) { foreach ( $ this -> countries as $ key => $ value ) { $ states = $ this -> get_states ( $ key ) ; if ( $ states ) { echo '<optgroup label="' . esc_attr ( $ value ) . '">' ; foreach ( $ states as $ state_key => $ state_value ) { echo '<option value="' . esc_attr ( $ key ) . ':' . esc_attr ( $ state_key ) . '"' ; if ( $ selected_country === $ key && $ selected_state === $ state_key ) { echo ' selected="selected"' ; } echo '>' . esc_html ( $ value ) . ' &mdash; ' . ( $ escape ? esc_js ( $ state_value ) : $ state_value ) . '</option>' ; } echo '</optgroup>' ; } else { echo '<option' ; if ( $ selected_country === $ key && '*' === $ selected_state ) { echo ' selected="selected"' ; } echo ' value="' . esc_attr ( $ key ) . '">' . ( $ escape ? esc_js ( $ value ) : $ value ) . '</option>' ; } } } }
Outputs the list of countries and states for use in dropdown boxes.
Outputs the list of countries and states for use in dropdown boxes .