Remove widget elementor (ok)
PreviousGaryJones/Gamajo-Template-Loader Template, giống woocommerce (ok)NextCách remove các widget mặc định trong wordpress (ok)
Last updated
Was this helpful?
Last updated
Was this helpful?
Tìm trong file C:\xampp\htdocs\reset\wp-content\plugins\elementor\includes\managers\widgets.php tìm theo unregister_widget_type
C:\xampp\htdocs\reset\wp-content\plugins\ecademy-toolkit\widgets\about-area-three.php
<?php
/**
* About Area Widget
*/
namespace Elementor;
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
class eCademy_About_Area_Three extends Widget_Base {
public function get_name() {
return 'About_Area_Three';
}
public function get_title() {
return esc_html__('About Area Three a', 'ecademy-toolkit');
}
public function get_icon() {
return 'eicon-info-box';
}
public function get_categories() {
return ['ecademy-elements'];
}
protected function _register_controls() {
$this->start_controls_section(
'eCademy_About_Area_Three',
[
'label' => esc_html__('eCademy About Area', 'ecademy-toolkit'),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'top_title',
[
'label' => esc_html__('Top Title', 'ecademy-toolkit'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Distance Learning', 'ecademy-toolkit'),
]
);
$this->add_control(
'title',
[
'label' => esc_html__('Title', 'ecademy-toolkit'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Build Your Skills Online, Anytime', 'ecademy-toolkit'),
]
);
$this->add_control(
'title_tag',
[
'label' => esc_html__('Title Tag', 'ecademy-toolkit'),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => esc_html__('h1', 'ecademy-toolkit'),
'h2' => esc_html__('h2', 'ecademy-toolkit'),
'h3' => esc_html__('h3', 'ecademy-toolkit'),
'h4' => esc_html__('h4', 'ecademy-toolkit'),
'h5' => esc_html__('h5', 'ecademy-toolkit'),
'h6' => esc_html__('h6', 'ecademy-toolkit'),
],
'default' => 'h2',
]
);
$this->add_control(
'content',
[
'label' => esc_html__('Content', 'ecademy-toolkit'),
'type' => Controls_Manager::TEXTAREA,
'default' => esc_html__('Want to learn and earn PDUs or CEUs on your schedule — anytime, anywhere? Or, pick up a new skill quickly like, project team leadership or agile? Browse our most popular online courses.', 'ecademy-toolkit'),
]
);
$this->add_control(
'strong_content',
[
'label' => esc_html__('Bold Content', 'ecademy-toolkit'),
'type' => Controls_Manager::TEXTAREA,
'default' => esc_html__('Grow your knowledge and your opportunities with thought leadership, training and tools.', 'ecademy-toolkit'),
]
);
$this->add_control(
'button_text',
[
'label' => esc_html__('Button Text', 'ecademy-toolkit'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('View All Courses', 'ecademy-toolkit'),
]
);
$this->add_control(
'button_icon',
[
'label' => esc_html__('Button Icon', 'ecademy-toolkit'),
'type' => Controls_Manager::ICON,
'label_block' => true,
'options' => ecademy_flaticons(),
]
);
$this->add_control(
'link_type',
[
'label' => esc_html__('Button Link Type', 'ecademy-toolkit'),
'type' => Controls_Manager::SELECT,
'label_block' => true,
'options' => [
'1' => esc_html__('Link To Page', 'ecademy-toolkit'),
'2' => esc_html__('External Link', 'ecademy-toolkit'),
],
]
);
$this->add_control(
'link_to_page',
[
'label' => esc_html__('Button Link Page', 'ecademy-toolkit'),
'type' => Controls_Manager::SELECT,
'label_block' => true,
'options' => ecademy_toolkit_get_page_as_list(),
'condition' => [
'link_type' => '1',
],
]
);
$this->add_control(
'ex_link',
[
'label' => esc_html__('Button External Link', 'ecademy-toolkit'),
'type' => Controls_Manager::TEXT,
'condition' => [
'link_type' => '2',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_images',
[
'label' => esc_html__('Images', 'ecademy-toolkit'),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'fimage',
[
'label' => esc_html__('About Area Image', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'fimage2',
[
'label' => esc_html__('About Area Image Two', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape1',
[
'label' => esc_html__('Shape Image One', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape2',
[
'label' => esc_html__('Shape Image Two', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape3',
[
'label' => esc_html__('Shape Image Three', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape4',
[
'label' => esc_html__('Shape Image Four', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape5',
[
'label' => esc_html__('Shape Image Five', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape6',
[
'label' => esc_html__('Shape Image Six', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape7',
[
'label' => esc_html__('Shape Image Seven', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape8',
[
'label' => esc_html__('Shape Image Eight', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->add_control(
'shape9',
[
'label' => esc_html__('Shape Image Nine', 'ecademy-toolkit'),
'type' => Controls_Manager::MEDIA,
]
);
$this->end_controls_section();
$this->start_controls_section(
'section_style',
[
'label' => esc_html__('Style', 'ecademy-toolkit'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'section_bg_color',
[
'label' => esc_html__('Section Background Color', 'ecademy-toolkit'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .about-area-three.ptb-100' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'top_title_color',
[
'label' => esc_html__('Top Title Color', 'ecademy-toolkit'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .about-content-box .sub-title' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'top_title_typography',
'label' => __('Top Title Typography', 'ecademy-toolkit'),
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .about-content-box .sub-title',
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__('Title Color', 'ecademy-toolkit'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .about-content-box h2, .about-content-box h3, .about-content-box h4, .about-content-box h5, .about-content-box h5, .about-content-box h6, .about-content-box h1' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => __('Title Typography', 'ecademy-toolkit'),
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .about-content-box h2, .about-content-box h3, .about-content-box h4, .about-content-box h5, .about-content-box h5, .about-content-box h6, .about-content-box h1',
]
);
$this->add_control(
'content_color',
[
'label' => esc_html__('Content Color', 'ecademy-toolkit'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .about-content-box p' => 'color: {{VALUE}}',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'content_typography',
'label' => __('Content Typography', 'ecademy-toolkit'),
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .about-content-box p',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
global $ecademy_opt;
if (isset($ecademy_opt['enable_lazyloader'])):
$is_lazyloader = $ecademy_opt['enable_lazyloader'];
else:
$is_lazyloader = true;
endif;
// Inline Editing
$this->add_inline_editing_attributes('title', 'none');
$this->add_inline_editing_attributes('content', 'none');
// Button Icon
if ($settings['button_icon'] != ''):
$icon = $settings['button_icon'];
else:
$icon = 'flaticon-user';
endif;
// Get Button Link
if ($settings['link_type'] == 1) {
$link = get_page_link($settings['link_to_page']);
} else {
$link = $settings['ex_link'];
}
?>
<div class="about-area-three ptb-100">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-5 col-md-12">
<div class="about-content-box">
<span class="sub-title"><?php echo esc_html($settings['top_title']); ?></span>
<<?php echo esc_attr($settings['title_tag']); ?> <?php echo $this->get_render_attribute_string('title'); ?>>
<?php echo esc_html($settings['title']); ?></<?php echo esc_attr($settings['title_tag']); ?>>
<p <?php echo $this->get_render_attribute_string('content'); ?>>
<?php echo wp_kses_post($settings['content']); ?></p>
<p><strong><?php echo wp_kses_post($settings['strong_content']); ?></strong></p>
<?php if ($settings['button_text'] != ''): ?>
<a href="<?php echo esc_url($link); ?>" class="default-btn"><i
class="<?php echo esc_attr($icon); ?>"></i><?php echo esc_html($settings['button_text']); ?><span></span></a>
<?php endif;?>
</div>
</div>
<div class="col-lg-7 col-md-12">
<div class="about-img">
<div class="image">
<?php if ($settings['fimage']['url'] != ''): ?>
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['fimage']['url']); ?>"
alt="<?php echo esc_attr__('About Us'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['fimage']['url']); ?>" alt="<?php echo esc_attr__('About Us'); ?>">
<?php endif;?>
<?php endif;?>
<?php if ($settings['fimage2']['url'] != ''): ?>
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['fimage2']['url']); ?>"
alt="<?php echo esc_attr__('About Us'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['fimage2']['url']); ?>" alt="<?php echo esc_attr__('About Us'); ?>">
<?php endif;?>
<?php endif;?>
</div>
<?php if ($settings['shape1']['url'] != ''): ?>
<div class="shape17">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape1']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape1']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape2']['url'] != ''): ?>
<div class="shape18">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape2']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape2']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape3']['url'] != ''): ?>
<div class="shape19">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape3']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape3']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape4']['url'] != ''): ?>
<div class="shape20">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape4']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape4']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape5']['url'] != ''): ?>
<div class="shape21">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape5']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape5']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape6']['url'] != ''): ?>
<div class="shape22">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape6']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape6']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape7']['url'] != ''): ?>
<div class="shape23">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape7']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape7']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
</div>
</div>
</div>
</div>
<?php if ($settings['shape8']['url'] != ''): ?>
<div class="shape3">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape8']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape8']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
<?php if ($settings['shape9']['url'] != ''): ?>
<div class="shape4">
<?php if ($is_lazyloader == true): ?>
<img sm-src="<?php echo esc_url($settings['shape9']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php else: ?>
<img src="<?php echo esc_url($settings['shape9']['url']); ?>"
alt="<?php echo esc_attr__('shape image', 'ecademy-toolkit'); ?>">
<?php endif;?>
</div>
<?php endif;?>
</div>
<?php
}
protected function _content_template() {}
}
Plugin::instance()->widgets_manager->register_widget_type(new eCademy_About_Area_Three);
Plugin::instance()->widgets_manager->unregister_widget_type('About_Area_Three');
?>