PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.2
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.2
4.9.2 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 All 200 releases
betterdocs / views / admin / customizer / controls / radio-image.php

radio-image.php in BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot 4.9.2, at views/admin/customizer/controls/radio-image.php

68 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- view template receives variables via extract(); prefixing is impractical.
3 // If this file is called directly, abort.
4 if ( ! defined( 'WPINC' ) ) {
5 die;
6 }
7
8 if ( empty( $control->choices ) ) {
9 return;
10 }
11
12 $name = '_customize-radio-' . $control->id;
13 ?>
14
15 <?php if ( ! empty( $control->label ) ) : ?>
16 <span class="customize-control-title betterdocs-customize-control-title">
17 <?php echo esc_html( $control->label ); ?>
18 </span>
19 <?php endif; ?>
20 <?php if ( ! empty( $control->description ) ) : ?>
21 <span class="description customize-control-description">
22 <?php echo esc_html( $control->description ); ?>
23 </span>
24 <?php endif; ?>
25
26 <div id="input_<?php echo esc_attr( $control->id ); ?>" class="image ui-buttonset">
27 <?php
28 foreach ( $control->choices as $value => $label ) {
29 if ( isset( $label['pro'] ) && $label['pro'] === true ) :
30 ?>
31 <label class="image-select" id="<?php echo esc_attr( $control->id . $value ); ?>">
32 <a
33 target="_blank"
34 href="<?php echo esc_url( $label['url'] ); ?>">
35 <img src="<?php echo esc_url( $label['image'] ); ?>" alt="">
36 </a>
37 <span class="go-pro"><?php esc_html_e( 'Go Pro', 'betterdocs' ); ?></span>
38 </label>
39 <?php else : ?>
40 <input
41 type="radio"
42 class="image-select"
43 value="<?php echo esc_attr( $value ); ?>"
44 id="<?php echo esc_attr( $control->id . $value ); ?>"
45 name="<?php echo esc_attr( $name ); ?>"
46 <?php
47 $control->link();
48 checked( $control->value(), $value );
49 ?>
50 >
51 <label for="<?php echo esc_attr( $control->id . $value ); ?>">
52 <img
53 src="<?php echo esc_url( $label['image'] ); ?>"
54 alt="<?php echo esc_attr( $value ); ?>"
55 title="<?php echo esc_attr( isset( $label['label'] ) ? $label['label'] : $value ); ?>" />
56 </label>
57 </input>
58 <?php
59 endif;
60 } // endforeach
61 ?>
62 </div>
63 <script>
64 jQuery(document).ready(function($) {
65 $( '[id="input_<?php echo esc_attr( $control->id ); ?>"]' ).buttonset();
66 });
67 </script>
68