Skip to content

Commit e3227d6

Browse files
authored
Tooltips, new info links and jqure migrate removal change
1 parent e524ef4 commit e3227d6

File tree

10 files changed

+1371
-0
lines changed

10 files changed

+1371
-0
lines changed

admin/css/admin-style.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
/**
3+
* Settings Block with Number Input Template
4+
* Reusable template for settings with checkbox + number input
5+
*
6+
* Expected variables:
7+
* @var string $title - Summary title
8+
* @var string $description - Main description text
9+
* @var string $savings - Optional savings description
10+
* @var string $setting_id - Setting ID (e.g., 'heartbeat', 'autosave')
11+
* @var string $checkbox_label - Checkbox label text
12+
* @var string $number_label - Number input label text
13+
* @var int $number_min - Minimum number value
14+
* @var int $number_max - Maximum number value
15+
* @var int $number_default - Default number value
16+
* @var string $number_description - Description for the number input
17+
* @var array $options - Settings options array
18+
* @var string $warning - Optional warning description (can be empty)
19+
* @var string $readmore - Optional URL, additional informations mostly on external sources
20+
*/
21+
22+
// If this file is called directly, abort.
23+
if (!defined('ABSPATH')) {
24+
die;
25+
}
26+
27+
$enabled = !empty($options[$setting_id . '_enabled']);
28+
$number_value = isset($options[$setting_id . '_interval']) ? $options[$setting_id . '_interval'] : $number_default;
29+
?>
30+
31+
<div class="single-bou-block">
32+
33+
<details>
34+
<summary>
35+
<?php echo esc_html($title); ?>
36+
<span class="more" data-tooltip="<?php esc_html_e( 'Click, to show more info.', 'bloatoff-utils' ); ?>">[?]</span>
37+
<?php if (!empty($warning)): echo '<span class="bou-warning-asterisk">*</span>'; endif; ?>
38+
</summary>
39+
<aside>
40+
<p>
41+
<span class="description"><?php echo esc_html($description); ?></span>
42+
<?php if (!empty($savings)): ?>
43+
<br>
44+
<span class="description bou-savings"><?php echo esc_html($savings); ?></span>
45+
<?php endif; ?>
46+
<?php if (!empty($warning)): ?>
47+
<br>
48+
<span class="description bou-warning"><?php echo esc_html($warning); ?></span>
49+
<?php endif; ?>
50+
<?php if (!empty($readmore)): ?>
51+
<br>
52+
<span class="description bou-readmore"><a href="<?php echo esc_url($readmore); ?>" rel="nofollow external" target="_blank">[<?php esc_html_e( 'Read more', 'bloatoff-utils' ); ?>]</a></span>
53+
<?php endif; ?>
54+
</p>
55+
</aside>
56+
</details>
57+
58+
<div class="bou-checkbox-wrap bou-number-wrap">
59+
<label>
60+
<input type="checkbox"
61+
class="bou-chbx"
62+
name="bloatoff_settings[<?php echo esc_attr($setting_id); ?>_enabled]"
63+
id="<?php echo esc_attr($setting_id); ?>_enabled"
64+
value="1"
65+
<?php checked($enabled, true); ?>>
66+
<?php echo esc_html($checkbox_label); ?>
67+
</label>
68+
69+
<div class="bou-number-input-wrap">
70+
<label for="<?php echo esc_attr($setting_id); ?>_interval">
71+
<?php echo esc_html($number_label); ?>
72+
</label>
73+
<input type="number"
74+
name="bloatoff_settings[<?php echo esc_attr($setting_id); ?>_interval]"
75+
id="<?php echo esc_attr($setting_id); ?>_interval"
76+
class="small-text"
77+
min="<?php echo esc_attr($number_min); ?>"
78+
max="<?php echo esc_attr($number_max); ?>"
79+
value="<?php echo esc_attr($number_value); ?>"
80+
<?php disabled($enabled, false); ?>>
81+
<span class="description">
82+
<?php echo esc_html($number_description); ?>
83+
</span>
84+
</div>
85+
</div>
86+
87+
</div>

admin/partials/settings-block.php

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
/**
3+
* Settings Block Template
4+
* Reusable template for individual setting blocks
5+
*
6+
* Expected variables:
7+
* @var string $title - Summary title
8+
* @var string $description - Main description text
9+
* @var string $savings - Optional savings description (can be empty)
10+
* @var string $warning - Optional warning description (can be empty)
11+
* @var string $readmore - Optional URL, additional informations mostly on external sources
12+
* @var string $setting_id - Checkbox setting ID (e.g., 'emojis', 'gutenberg')
13+
* @var string $label - Checkbox label text
14+
* @var array $options - Settings options array
15+
*/
16+
17+
// If this file is called directly, abort.
18+
if (!defined('ABSPATH')) {
19+
die;
20+
}
21+
?>
22+
23+
<div class="single-bou-block">
24+
25+
<details>
26+
<summary>
27+
<?php echo esc_html($title); ?>
28+
<span class="more" data-tooltip="<?php esc_html_e( 'Click, to show more info.', 'bloatoff-utils' ); ?>">[?]</span>
29+
<?php if (!empty($warning)): echo '<span class="bou-warning-asterisk">*</span>'; endif; ?>
30+
</summary>
31+
<aside>
32+
<p>
33+
<span class="description"><?php echo esc_html($description); ?></span>
34+
<?php if (!empty($savings)): ?>
35+
<br>
36+
<span class="description bou-savings"><?php echo esc_html($savings); ?></span>
37+
<?php endif; ?>
38+
<?php if (!empty($warning)): ?>
39+
<br>
40+
<span class="description bou-warning"><?php echo esc_html($warning); ?></span>
41+
<?php endif; ?>
42+
<?php if (!empty($readmore)): ?>
43+
<br>
44+
<span class="description bou-readmore"><a href="<?php echo esc_url($readmore); ?>" rel="nofollow external" target="_blank">[<?php esc_html_e( 'Read more', 'bloatoff-utils' ); ?>]</a></span>
45+
<?php endif; ?>
46+
</p>
47+
</aside>
48+
</details>
49+
50+
<div class="bou-checkbox-wrap">
51+
<label>
52+
<input type="checkbox"
53+
class="bou-chbx"
54+
name="bloatoff_settings[<?php echo esc_attr($setting_id); ?>]"
55+
value="1"
56+
<?php checked(!empty($options[$setting_id]), true); ?>>
57+
<?php echo esc_html($label); ?>
58+
</label>
59+
</div>
60+
61+
</div>

0 commit comments

Comments
 (0)