: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Saltus\WP\Plugin\Saltus\InteractiveMaps\Plugin\Integrations;
* Elementor IGMap Widget.
* Elementor widget to add a previously created interactive map
class ElementorMapWidget extends \Elementor\Widget_Base {
* Retrieve IGMap widget name.
* @return string Widget name.
public function get_name() {
* Retrieve IGMap widget title.
* @return string Widget title.
public function get_title() {
return __( 'Interactive Geo Map', 'interactive-geo-maps' );
* Retrieve IGMap widget icon.
* @return string Widget icon.
public function get_icon() {
* Retrieve the list of categories the IGMap widget belongs to.
* @return array Widget categories.
public function get_categories() {
* Register IGMap widget controls.
* Adds different input fields to allow the user to change and customize the widget settings.
protected function register_controls() {
'suppress_filters' => true,
$maps = get_posts( $args );
foreach ( $maps as $key => $map ) {
$options[ $map->ID ] = $map->post_title;
$options['default'] = __( 'Select Map to display', 'interactive-geo-maps' );
$this->start_controls_section(
'label' => __( 'Map to display', 'interactive-geo-maps' ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'label' => __( 'Map', 'interactive-geo-maps' ),
'type' => \Elementor\Controls_Manager::SELECT,
$this->end_controls_section();
* Render IGMap widget output on the frontend.
* Written in PHP and used to generate the final HTML.
protected function render() {
$settings = $this->get_settings_for_display();
$map_id = $settings['mapID'];
if ( $map_id && $map_id !== 'default' ) {
$image_meta = get_post_meta( $map_id, 'map_image', true );
$image = isset( $image_meta['mapImage'] ) && $image_meta['mapImage'] !== '' ? $image_meta['mapImage'] : '';
$html = sprintf( '<img src="%s">', $image );
$html .= '<br><div style="text-align:center; font-size:0.8em;">' . __( 'Preview Only', 'interactive-geo-maps' ) . '</div>';
$html = __( 'Please select a map', 'interactive-geo-maps' );
$html = do_shortcode( '[display-map id="' . $map_id . '"]' );
echo '<div class="igmap-elementor-widget">';