I’m injecting a custom control section to the container widget including a Custom field. Now, I want to get the value from this field, modify it, and then output it along with the child heading widget.
function inject_heading_controls( $element, $args ) {
$element->start_controls_section(
'custom_field_group',
[
'tab' => ElementorControls_Manager::TAB_LAYOUT,
'label' => esc_html__( 'Custom Field Group', WDAEA_TEXTDOMAIN ),
]
);
$element->add_control(
'custom_field',
[
'type' => ElementorControls_Manager::TEXT,
'label' => esc_html__( 'Custom Field', WDAEA_TEXTDOMAIN ),
]
);
$element->end_controls_section();
}
add_action( 'elementor/element/container/section_layout_container/before_section_start', 'inject_heading_controls', 10, 2 );
I want to concatenate " 15 "
with the value from the field.
Here my expected outcome is: We have 15 Real estate projects.