refactor(widgets): remove shared redundant settings

This commit is contained in:
2026-08-16 15:03:49 +08:00
parent 30b08282f5
commit d97174dadb
31 changed files with 199 additions and 1321 deletions
+1 -4
View File
@@ -7,12 +7,10 @@
namespace AKSRT\Widgets;
use AKSRT\Widgets\Traits\CommonWidgetFields;
defined('ABSPATH') || exit;
class WidgetIframe extends \WP_Widget {
use CommonWidgetFields;
public function __construct() {
@@ -141,7 +139,6 @@ class WidgetIframe extends \WP_Widget {
<label><input type="checkbox" name="<?php echo esc_attr($this->get_field_name('allowfullscreen')); ?>" value="1" <?php checked(!empty($instance['allowfullscreen'])); ?>> <?php esc_html_e('允许全屏', 'aksrt'); ?></label>
</p>
<?php
$this->render_common_form_section($instance);
}
/**
@@ -155,6 +152,6 @@ class WidgetIframe extends \WP_Widget {
'url' => trim((string) ($new_instance['url'] ?? '')),
'aspect' => max(20, min(300, (int) ($new_instance['aspect'] ?? 55))),
'allowfullscreen' => !empty($new_instance['allowfullscreen']) ? 1 : 0,
]; return $this->update_common_fields($new_instance, $old_instance, $business);
]; return $business;
}
}