PluginProbe
GDPRess | Eliminate external requests to increase GDPR compliance / trunk
GDPRess | Eliminate external requests to increase GDPR compliance vtrunk
trunk 1.0.2 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1
gdpr-press / src / Admin / Settings / Builder.php

Builder.php in GDPRess | Eliminate external requests to increase GDPR compliance trunk, at src/Admin/Settings/Builder.php

79 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 * @package GDPRess
4 * @author Daan van den Bergh
5 * https://daan.dev
6 */
7
8 namespace GDPRess\Admin\Settings;
9
10 class Builder {
11 /**
12 * Builder constructor.
13 */
14 public function __construct() {
15 }
16
17 /**
18 *
19 */
20 public function do_after() {
21 ?>
22 </table>
23 <?php
24 }
25
26 /**
27 *
28 */
29 public function do_before() {
30 ?>
31 <table class="form-table">
32 <?php
33 }
34
35 /**
36 * Generate checkbox setting.
37 *
38 * @param $label
39 * @param $name
40 * @param $checked
41 * @param $description
42 */
43 public function do_checkbox( $label, $name, $checked, $description, $disabled = false, $visible = true ) {
44 ?>
45 <tr class='<?php echo str_replace( '_', '-', esc_attr( $name ) ); ?>-row' <?php echo $visible ? '' : 'style="display: none;"'; ?>>
46 <th scope="row"><?php echo apply_filters( $name . '_setting_label', esc_attr( $label ) ); ?></th>
47 <td>
48 <label for="<?php echo esc_attr( $name ); ?>">
49 <input <?php echo apply_filters( $name . '_setting_disabled', $disabled ) ? 'disabled' : ''; ?>
50 type="checkbox"
51 class="<?php echo str_replace( '_', '-', esc_attr( $name ) ); ?>"
52 name="<?php echo esc_attr( $name ); ?>" <?php echo $checked === 'on' ? 'checked = "checked"' : ''; ?>
53 />
54 <?php echo apply_filters( $name . '_setting_description', wp_kses( $description, 'code' ) ); ?>
55 </label>
56 </td>
57 </tr>
58 <?php
59 }
60
61 /**
62 *
63 */
64 public function do_tbody_close() {
65 ?>
66 </tbody>
67 <?php
68 }
69
70 /**
71 * @param $class
72 */
73 public function do_tbody_open( $class ) {
74 ?>
75 <tbody class="<?php echo esc_attr( $class ); ?>">
76 <?php
77 }
78 }
79