Contact Form 7 Conditional redirect

I got an answer. We need to grab the code inside the Event Listener code like this: <script type=”text/javascript”> document.addEventListener( ‘wpcf7submit’, function( event ) { inputs = event.detail.inputs; inputs.forEach( function(el) { if ( el.name == “menu-52” ) { if ( el.value == “Below $10,000” ) { location.href = “https://www.facebook.com”; } else if ( el.value == … Read more

Access checks with custom REST endpoints and backbone

The issue was I overrode the Backbone.sync method only in Backbone.Model. When Backbone fetches the initial data (GET) it is using the sync method in Backbone.collections. So I need to override the sync in Backbone.Collections: app.Collection = Backbone.Collection.extend({ sync: function( method, model, options ){ return Backbone.sync(method, this, jQuery.extend( options, { beforeSend: function (xhr) { xhr.setRequestHeader( … Read more