PluginProbe
WPCasa – Real Estate for WordPress / trunk
WPCasa – Real Estate for WordPress vtrunk
1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.1.1 trunk 1.2.0 1.2.1 1.2.10 1.2.10.1 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.2.9.1 1.2.9.2 1.3.0 All 31 releases
wpcasa / includes / admin / views / option-select.php

option-select.php in WPCasa – Real Estate for WordPress trunk, at includes/admin/views/option-select.php

30 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
4 if (isset($option)) {
5 $option_type = isset( $option['type'] ) ? $option['type'] : '';
6 $option_id = isset( $option['id'] ) ? $this->settings_name . '[' . $option['id'] . ']' : '';
7 $option_css = sanitize_html_class( $this->settings_name . '_' . $option['id'] );
8
9 $option_options = isset( $option['options'] ) ? $option['options'] : '';
10
11 $attributes = array();
12 if ( isset( $option['attributes'] ) && is_array( $option['attributes'] ) ) {
13 foreach ( $option['attributes'] as $attribute_name => $attribute_value ) {
14 $attributes[] = esc_attr( $attribute_name ) . '="' . esc_attr( $attribute_value ) . '"';
15 }
16 }
17
18 $value = wpsight_get_option( $option['id'] );
19 if( !isset( $value ) && isset( $option['default'] ) ) $value = $option['default'];
20 ?>
21
22 <div class="wpsight-settings-field wpsight-settings-field-<?php echo esc_attr( $option_type ); ?>">
23 <select id="setting-<?php echo esc_attr( $option_css ); ?>" class="regular-text" name="<?php echo esc_attr( $option_id ); ?>" <?php echo esc_attr( implode( ' ', $attributes ) ); ?>><?php
24 foreach( $option_options as $key => $name )
25 echo '<option value="' . esc_attr( $key ) . '" ' . selected( $value, $key, false ) . '>' . esc_html( $name ) . '</option>'; ?>
26 </select>
27 </div>
28
29 <?php } ?>
30