I’m trying to get a redirect going. There are only 3 google results 1 of which provided the solution below.

Is there any way to do a redirect specifically for the form instead of all submissions?

I don’t want to change the plugin and have this wiped out on update either.

Instead of using front-subscribers.js, is there was way to give each form its own redirect using functions.js?

  1. Open the file cheapproducts4you.com/wp-content/plugins/wysija-newsletters/js/front-subscribers.js
    for editing. ( copy the file to your local system before hand as
    backup )
  2. Simply replace all the code inside that file with below code. Then save the file.
jQuery(function(e){void 0===e.fn.on&&(e.fn.on=function(t,n,r,s){return"function"==typeof n?e(this.context).live(t,n):e(n).live(t,r,s),this}),e(document).on("click",".showerrors",function(){return e(".xdetailed-errors").toggle(),!1}),e(document).on("click",".shownotices",function(){return e(".xdetailed-updated").toggle(),!1}),e("form.widget_wysija").on("focus","input[placeholder]",function(){e(this).val()===e(this).attr("placeholder")&&e(this).val("")}),e("form.widget_wysija").on("blur","input[placeholder]",function(){""===e(this).val()&&e(this).val(e(this).attr("placeholder"))}),e("form.widget_wysija").on("focus","input.defaultlabels",function(){e(this).val()===e(this).attr("title")&&e(this).val("")}),e("form.widget_wysija").on("blur","input.defaultlabels",function(){""===e(this).val()&&e(this).val(e(this).attr("title"))}),e(document).on("submit","form.widget_wysija",function(t){if(t.preventDefault(),void 0!==wysijaAJAX.noajax)return e(this).validationEngine("validate");if(e(this).validationEngine("validate")===!0){var n=e(this).find('input[name="action"]').val(),r=e(this).find('input[name="controller"]').val(),s=e(this).attr("id"),o=e(this).serializeArray();wysijaAJAX.task=n,wysijaAJAX.controller=r,wysijaAJAX.formid=s,e.each(o,function(e,t){wysijaAJAX["data["+e+"][name]"]=t.name,wysijaAJAX["data["+e+"][value]"]=t.value}),e("#msg-"+s).html('<div class="allmsgs"><blink>'+wysijaAJAX.loadingTrans+"</blink></div>"),e("#"+s).fadeOut(),e.ajax({type:"post",url:wysijaAJAX.ajaxurl,data:wysijaAJAX,success:function(t){e("#msg-"+s).html('<div class="allmsgs"></div>'),t.result||e("#"+s).fadeIn(),e.each(t.msgs,function(t,n){e("#msg-"+s+" .allmsgs ."+t+" ul").length||e("#msg-"+s+" .allmsgs").append('<div class="'+t+'"><ul></ul></div>'),e.each(n,function(n,r){e("#msg-"+s+" .allmsgs ."+t+" ul").append("<li>"+r+"</li>")})});window.location.href=window.location.href},error:function(t,n,r){e("#msg-"+s).html('<div class="allmsgs"></div>'),e("#msg-"+s+" .allmsgs").html('<div class="error"><ul><li>Oops! There is a problem with this form:</li><li>textStatus:'+n+"</li><li>errorThrown:"+r+"</li><li>responseText:"+t.responseText+"</li></ul></div>")},dataType:"jsonp"})}return!1}),e(function(){e("form.widget_wysija").validationEngine("attach",{promptPosition:"centerRight",scroll:!1}),e("form.widget_wysija").bind("jqv.form.validating",function(){e(this).find("input[placeholder]").each(function(){e(this).val()===e(this).attr("placeholder")&&e(this).val("")})}),e("form.widget_wysija").find("input[placeholder]").each(function(){""===e(this).val()&&e(this).val(e(this).attr("placeholder"))}),e("form.widget_wysija").bind("jqv.form.validating",function(){e(this).find("input.defaultlabels").each(function(){e(this).val()===e(this).attr("title")&&e(this).val("")})}),e("form.widget_wysija").find("input.defaultlabels").each(function(){""===e(this).val()&&e(this).val(e(this).attr("title"))})})})

Read more here: MailPoet Subscrition Form Redirect


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , ,

Wordpress related questions and answers: