Adding extra fields to an existing Elementor widget
- Post date
- Categories In Web Development, WordPress
- Tags Elementor, php
Following on from creating your own Elementor widgets it is possible to add extra fields to existing widgets.
Again there are no hooks or filters for this, we’ll be interacting with the Elementor class directly.
https://gist.github.com/dtbaker/aacac996beddc3bcfb1632c3b3d5347b
Pretty easy.
Hi
It gives me fatal error
Fatal error: Call to undefined method ElementorWidgets_Manager::get_widget()
Yep I have to update this example to work with the latest version of Elementor. Stay tuned. I’ll probably tweet about it @dtbaker if you want to watch for it.
Updated : http://dtbaker.net/web-development/adding-extra-fields-to-an-existing-elementor-widget/
Thanks for your reply Dave but it change nothings in my edit image box. I can’t see the custom “select” drop down . I get a quick warning saying that it miss args 2 and 3 in the add_action(‘elementor/element/before_section_end’, function($section, $section_id, $args) line. the warning lasts less than a second before disappering
Try now, with that added
10, 3
at the bottomI think I added a comment to a different post. I see how I can add extra fields to an existing widget, however, with the example of the Image widget, how do I use a select control similar to the image widget, where when I select a specific field, it will reference the image attachment’s meta field?