refactor(widgets): remove shared redundant settings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user