PluginProbe
Modal Window – create popup modal window / 5.3
Modal Window – create popup modal window v5.3
6.3 trunk 2.5 3.1.1 3.1.2 3.2.2 4.0.1 4.0.3 5.0.6 5.1.1 5.2 5.2.1 5.2.2 5.2.3 5.3 5.3.1 5.3.10 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.3.8 5.3.9 All 45 releases
modal-window / admin / fields / checkbox.php

checkbox.php in Modal Window – create popup modal window 5.3, at admin/fields/checkbox.php

56 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for field checkbox
4 *
5 * @package Wow_Plugin
6 * @copyright Copyright (c) 2018, Dmytro Lobov
7 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8 * @since 1.0
9 */
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 $label = ! empty( $arg['label'] ) ? $arg['label'] : '';
16 $attr = ! empty( $arg['attr'] ) ? $arg['attr'] : '';
17 $help = ! empty( $arg['help'] ) ? $arg['help'] : '';
18 $icon = ! empty( $arg['icon'] ) ? $arg['icon'] : '';
19 $tooltip = ! empty( $arg['tooltip'] ) ? $arg['tooltip'] : '';
20
21 $add_field_class = ! empty( $arg['attr']['class'] ) ? ' ' . $arg['attr']['class'] : '';
22 $field_classes = 'is-radiusless ' . $add_field_class;
23
24 $attributes = '';
25 foreach ( $attr as $key => $val ) {
26 if ( $key == 'class' || $key == 'value' ) {
27 continue;
28 }
29 $attributes .= esc_attr( $key ) . '="' . esc_attr( $val ) . '"';
30 }
31
32 if ( ! empty( $arg['func'] ) ) {
33 $attributes .= 'onclick="' . esc_attr( $arg['func'] ) . '();"';
34 }
35
36 $checked = ! empty( $attr['value'] ) ? ' checked="checked"' : '';
37
38 ?>
39
40 <div class="field">
41 <label class="label checkbox" for="<?php echo esc_attr( $attr['id'] ); ?>">
42 <input type="hidden" name="<?php echo esc_attr( $attr['name'] ); ?>">
43 <input class="<?php echo esc_attr( $field_classes ); ?>"
44 type="checkbox" <?php echo $attributes . $checked; ?> value="1">
45 <?php echo esc_attr( $label ); ?>
46 <?php if ( ! empty( $tooltip ) ) : ?>
47 <span class="is-primary has-tooltip-multiline has-tooltip-right"
48 data-tooltip="<?php echo esc_attr( $tooltip ); ?>">
49 <span class="wow-help dashicons dashicons-editor-help"></span>
50 </span>
51 <?php endif; ?>
52 </label>
53 </div>
54 <?php if ( ! empty( $help ) ) : ?>
55 <p class="help is-info"><?php echo $help; ?></p>
56 <?php endif; ?>