: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Leadin\admin\widgets;
use Elementor\Widget_Base;
class ElementorForm extends Widget_Base {
public function get_name() {
public function get_title() {
return esc_html( 'HubSpot Form' );
public function get_icon() {
return 'eicon-form-horizontal';
public function get_custom_help_url() {
return 'https://wordpress.org/support/plugin/leadin/';
public function get_categories() {
return array( 'general', 'hubspot' );
public function get_keywords() {
return array( 'hubspot', 'form', 'leadin' );
public function get_style_depends() {
wp_register_style( 'leadin-elementor', LEADIN_JS_BASE_PATH . '/elementor.css', array(), LEADIN_PLUGIN_VERSION );
wp_register_style( 'leadin-css', LEADIN_ASSETS_PATH . '/style/leadin.css', array(), LEADIN_PLUGIN_VERSION );
return array( 'leadin-elementor', 'leadin-css' );
public function get_script_depends() {
Filters::apply_forms_script_url_filters(),
return array( 'leadin-forms-v2' );
protected function register_controls() {
$this->start_controls_section(
'label' => esc_html( __( 'Form', 'leadin' ) ),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'type' => 'leadinformselect',
$this->end_controls_section();
protected function render() {
$settings = $this->get_settings_for_display();
$content = $settings['content'];
if ( Plugin::$instance->editor->is_edit_mode() ) {
<div class="hubspot-form-edit-mode" data-attributes="<?php echo esc_attr( json_encode( $content ) ); ?>">
if ( empty( $content ) ) {
<div class="hubspot-widget-empty">
if ( ! empty( $content ) ) {
$portal_id = $content['portalId'];
$form_id = $content['formId'];
echo do_shortcode( '[hubspot portal="' . $portal_id . '" id="' . $form_id . '" type="form"]' );