PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 1.0.0
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v1.0.0
4.9.1 4.9.0 4.8.2 4.8.1 4.8.0 4.7.0 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 4.5.1 4.5.0 4.4.1 4.4.0 3.3.4 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.5.2 All 199 releases
betterdocs / admin / includes / fields / betterdocs-select.php

betterdocs-select.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 1.0.0, at admin/includes/fields/betterdocs-select.php

27 lines 1016 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 $class .= ' betterdocs-select';
3
4 $multiple = isset( $field['multiple'] ) ? 'multiple' : '';
5
6 if( $multiple ) {
7 $name .= "[]";
8 }
9
10 if( isset( $field['disable'] ) && $field['disable'] == true ) {
11 $attrs .= ' disabled';
12 }
13 ?>
14 <select data-value="<?php echo is_array( $value ) ? implode( ',', $value ) : $value; ?>" class="<?php echo esc_attr( $class ); ?>" <?php echo $multiple; ?> name="<?php echo $name; ?>" id="<?php echo $field_id; ?>" <?php echo $attrs; ?>>
15 <?php
16 if( ! empty( $field['options'] ) ) :
17 foreach( $field['options'] as $opt_id => $option ) {
18 if( is_array( $value ) ) {
19 $selected = in_array( $opt_id, $value ) ? 'selected="true"' : '';
20 } else {
21 $selected = ( $value == $opt_id ) ? 'selected="true"' : '';
22 }
23 echo '<option value="'. $opt_id .'" '. $selected .'>'. $option .'</option>';
24 }
25 endif;
26 ?>
27 </select>