PluginProbe
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot / 4.9.3
BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ & Chatbot v4.9.3
4.9.3 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 All 201 releases
← All changes | views/admin/customizer/controls/radio-image.php +55 -53 3.4.0 → 4.9.3 View file →
@@ -1,65 +1,67 @@
1 1 <?php
2 - // If this file is called directly, abort.
3 - if ( ! defined( 'WPINC' ) ) {
4 - die;
5 - }
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 +}
6 7
7 - if ( empty( $control->choices ) ) {
8 - return;
9 - }
8 +if ( empty( $control->choices ) ) {
9 + return;
10 +}
10 11
11 - $name = '_customize-radio-' . $control->id;
12 + $name = '_customize-radio-' . $control->id;
12 13 ?>
13 14
14 -<?php if ( ! empty( $control->label ) ): ?>
15 - <span class="customize-control-title betterdocs-customize-control-title">
16 - <?php echo esc_html( $control->label ); ?>
17 - </span>
18 -<?php endif;?>
19 -<?php if ( ! empty( $control->description ) ): ?>
20 - <span class="description customize-control-description">
21 - <?php echo esc_html( $control->description ); ?>
22 - </span>
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>
23 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; ?>
24 25
25 -<div id="input_<?php echo $control->id; ?>" class="image ui-buttonset">
26 +<div id="input_<?php echo esc_attr( $control->id ); ?>" class="image ui-buttonset">
26 27 <?php
27 - foreach ( $control->choices as $value => $label ) {
28 - if ( isset( $label['pro'] ) && $label['pro'] === true ):
29 - ?>
30 - <label class="image-select" id="<?php echo $control->id . $value ?>">
31 - <a
32 - target="_blank"
33 - href="<?php echo esc_url( $label['url'] ) ?>">
34 - <img src="<?php echo esc_url( $label['image'] ) ?>" alt="">
35 - </a>
36 - <span class="go-pro"><?php _e( 'Go Pro', 'betterdocs' )?></span>
37 - </label>
38 -<?php else: ?>
39 - <input
40 - type="radio"
41 - class="image-select"
42 - value="<?php echo esc_attr( $value ) ?>"
43 - id="<?php echo $control->id . $value; ?>"
44 - name="<?php echo esc_attr( $name ) ?>"
45 - <?php
46 - $control->link();
47 - checked( $control->value(), $value );
48 - ?>>
49 - <label for="<?php echo $control->id . $value; ?>">
50 - <img
51 - src="<?php echo esc_url( $label['image'] ) ?>"
52 - alt="<?php echo esc_attr( $value ) ?>"
53 - title="<?php echo esc_attr( isset( $label['label'] ) ? $label['label'] : $value ); ?>" />
54 - </label>
55 - </input>
56 -<?php
57 - endif;
58 - } // endforeach
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
59 61 ?>
60 62 </div>
61 63 <script>
62 - jQuery(document).ready(function($) {
63 - $( '[id="input_<?php echo $control->id; ?>"]' ).buttonset();
64 - });
64 + jQuery(document).ready(function($) {
65 + $( '[id="input_<?php echo esc_attr( $control->id ); ?>"]' ).buttonset();
66 + });
65 67 </script>