feat(widgets): unregister core WP widgets; About guest signin-loader
Align widget area with zibll by removing default RSS/search/calendar widgets, and make About guest login buttons open auth modal classes.
This commit is contained in:
1 parent
53d85c6ebd
commit
5f398dd9d0
3 files changed
+22
-7
No files matched your search
@@ -19,7 +19,7 @@ class CustomHtmlGapWidget extends \WP_Widget {
|
||||
$mode = sanitize_key($instance['mode'] ?? 'html');
|
||||
|
||||
if ($mode === 'gap') {
|
||||
$height = max(0, min(200, (int) ($instance['gap_height'] ?? 20)));
|
||||
$height = max(0, min(500, (int) ($instance['gap_height'] ?? 20)));
|
||||
echo '<div class="widget-custom-gap" style="height:' . (int) $height . 'px;" aria-hidden="true"></div>';
|
||||
return;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ class CustomHtmlGapWidget extends \WP_Widget {
|
||||
</p>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id('gap_height'); ?>"><?php esc_html_e('间距高度(px,仅间距模式):', 'aksrt'); ?></label>
|
||||
<input class="tiny-text" type="number" min="0" max="200" id="<?php echo $this->get_field_id('gap_height'); ?>" name="<?php echo $this->get_field_name('gap_height'); ?>" value="<?php echo (int) ($instance['gap_height'] ?? 20); ?>">
|
||||
<input class="tiny-text" type="number" min="0" max="500" id="<?php echo $this->get_field_id('gap_height'); ?>" name="<?php echo $this->get_field_name('gap_height'); ?>" value="<?php echo (int) ($instance['gap_height'] ?? 20); ?>">
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class CustomHtmlGapWidget extends \WP_Widget {
|
||||
'mode' => in_array($new_instance['mode'] ?? '', ['html', 'gap'], true) ? $new_instance['mode'] : 'html',
|
||||
'title' => sanitize_text_field($new_instance['title'] ?? ''),
|
||||
'content' => wp_kses_post($new_instance['content'] ?? ''),
|
||||
'gap_height' => max(0, min(200, (int) ($new_instance['gap_height'] ?? 20))),
|
||||
'gap_height' => max(0, min(500, (int) ($new_instance['gap_height'] ?? 20))),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user