You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone a sample widget, whole folder. Eg: can use header widget as an example
Rename the widget folder and its PHP + SCSS files. They all must have the same name. If the widget name has more than 1 word, make sure to use dash - to separate words. Eg: featured-heading
Open the PHP file and rename the widget class name, make sure to include Elem_ as prefix (for autoload), capitalize words and use underscore _ to separate words, . Eg: Elem_Featured_Heading
In widget PHP file:
Update get_title() function with new widget name, Eg: Featured Heading
If the widget requires extra libraries, add to get_style_depends() and get_script_depends(). Make sure to register the asset first, can register either in the widget _register_assets() or in app/core/setup.php >> enqueue_scripts() (if the libraries are used across different widgets)
Add the widget controls to register_controls(). For more controls, check this Elementor document.
Add widget HTML and JS to render(), make sure to update $uid and the wrapper class
Go to app/modules/elementor/elementor.php and register the widget in init_widgets()
TIPS
Access app helpers functions using App_Core::instance()->helpers, eg:
App_Core::instance()->helpers->get_page_title();
SCSS media query using @include media-breakpoint-up() and @include media-breakpoint-down() eg: