plugin_url() ) . '/assets/'; } public function set_control_groups() { /*$this->control_groups['form'] = [ 'title' => esc_html__( 'Form', 'propertyhive' ), 'tab' => 'content', // content / style ];*/ } public function set_controls() { $this->controls['map_link_type'] = [ 'tab' => 'content', //'group' => 'settings', 'label' => esc_html__( 'Link Type', 'propertyhive' ), 'type' => 'select', 'options' => array( '_blank' => 'Open map in new window', 'embedded' => 'Open embedded map in lightbox', 'iframe' => 'Open iframe map in lightbox', ), 'default' => '_blank', ]; } public function render() { global $property; if ( !isset($property->id) ) { return; } if ( $property->latitude == '' || $property->longitude == '' || $property->latitude == '0' || $property->longitude == '0' ) { return; } $root_classes[] = $this->name; // Add 'class' attribute to element root tag $this->set_attribute( '_root', 'class', $root_classes ); echo "
render_attributes( '_root' )}>"; $link_type = ( isset($this->settings['map_link_type']) && !empty($this->settings['map_link_type']) ) ? $this->settings['map_link_type'] : '_blank'; switch ($link_type) { case "_blank": { echo '' . esc_html(__( 'View Map', 'propertyhive' )) . ''; break; } case "embedded": { echo '' . esc_html(__( 'View Map', 'propertyhive' )) . ''; echo ''; break; } case "iframe": { echo '' . esc_html(__( 'View Map', 'propertyhive' )) . ''; break; } } echo '
'; } }