For anyone who stumbles upon this thread:
I found this answer buried somewhere in an Elementor GitHub issue. May it help someone else too:
Original Question by rahulv3a:
Is it possible to call an Elementor widget programmatically with custom arguments like we can call WordPress widgets using
the_widget( $widget_class_name, $instance, $args );
?
Original Answer by bainternet:
Yes its possible, simply create an instance of the widget class and use print_element method. eg:
$heading_widget = \Elementor\Plugin::instance()->elements_manager->create_element_instance(
[
'elType' => 'widget',
'widgetType' => 'heading',
'id' => 'stubID',
'settings' => [
'title' => 'custom Heading from code',
],
],
[]
);
$heading_widget->print_element();
I am not 100% sure this solution is viable in the case described above, but I feel it is definitely a good starting point a for different approach.