Remove Specific Campaign Based on the Referral URL

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(document.referrer.search.indexOf(‘google.com’) > 0) { // replace with the specific referral domain var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID’); // replace CAMPAIGN_ID with the unique ID for your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove Specific Campaign From Any URLs Containing a Specific URL Path

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.search.indexOf(‘shopping-cart’) > -1) { // replace shopping-cart wtih your specific URL path var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID’); // replace CAMPAIGN_ID with the unique ID of your campaign optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove Specific Campaign From a Specific URL

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.href == ‘https://example.com/specific-page’) { // replace with your specific URL var optinCampaign = document.querySelector(‘#om-CAMPAIGN_ID’); // replace CAMPAIGN_ID with your campaign’s unique ID optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Remove All Campaigns From a Specific URL

document.addEventListener(‘om.Campaign.startShow’, function(event) { if(window.location.href == ‘https://example.com/specific-page’) { // replace with your specific URL var optinCampaign = document.querySelector(‘#om-‘ + event.detail.Campaign.id); optinCampaign.parentNode.removeChild(optinCampaign); } });Continue reading

Localizing Date Picker Strings (copy)

/** * Load the date picker locale strings. * * @link https://wpforms.com/developers/localize-the-date-picker-strings/ */ function wpf_dev_datepicker_locale( $forms ) { if ( true === wpforms_has_field_type( ‘date-time’, $forms, true )){ wp_enqueue_script( ‘wpforms-datepicker-locale’, ‘https://npmcdn.com/[email protected]/dist/l10n/es.js’, array( ‘wpforms-flatpickr’ ), null, true ); } } add_action( ‘wpforms_frontend_js’,…Continue reading