: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
/* global wpforms, wpformsElementorVars, wpformsModernFileUpload, wpformsRecaptchaLoad, grecaptcha */
* WPForms integration with Elementor on the frontend.
* @since 1.6.2 Moved from `wpforms-elementor.js`
var WPFormsElementorFrontend = window.WPFormsElementorFrontend || ( function( document, window, $ ) {
* Public functions and properties.
window.addEventListener( 'elementor/popup/show', function( event ) {
let $modal = $( '#elementor-popup-modal-' + event.detail.id ),
$form = $modal.find( '.wpforms-form' );
* Init all things for WPForms.
* @param {object} $form jQuery selector.
initFields: function( $form ) {
// Init `Modern File Upload` field.
if ( 'undefined' !== typeof wpformsModernFileUpload ) {
wpformsModernFileUpload.init();
if ( 'undefined' !== typeof wpformsRecaptchaLoad ) {
if ( 'recaptcha' === wpformsElementorVars.captcha_provider && 'v3' === wpformsElementorVars.recaptcha_type ) {
if ( 'undefined' !== typeof grecaptcha ) {
grecaptcha.ready( wpformsRecaptchaLoad );
// Register a custom event.
$( document ).trigger( 'wpforms_elementor_form_fields_initialized', [ $form ] );
}( document, window, jQuery ) );
WPFormsElementorFrontend.init();