Elementor 开发者文档

title: "Widget Optimization" post_status: publish comment_status: open taxonomy: category: - elementor-developers-docs post_tag: - Widgets - Src - Repos


Widget Optimization

Elementor provides various methods to optimize widgets and enhance performance. To maintain backward compatibility, not all optimizations are applied to every widget. Additionally, each widget has unique characteristics, so certain optimizations may not be applicable in all cases.

Performance Optimization Methods

Widget developers can implement the following two optional methods in their widget classes to help Elementor handle widgets more efficiently:

class Elementor_Test_Widget extends \Elementor\Widget_Base {

    public function has_widget_inner_wrapper(): bool {}

    protected function is_dynamic_content(): bool {}

}