Results page
-
Hello,
I was working with this plugin and noticed that the “save results pages” wasn’t working – I tinkered a bit and got it to display the way I wanted by looking at the ‘qsm-admin-results.js’ file – I got it to a point where it “saved” – but when I left the tab – it was gone again. To get it to “kind of” work so that I could test in my local environment, I made these changes based on the ‘qsm-admin-question.js’ file:
saveResults: function() { QSMAdmin.displayAlert( 'Saving results pages...', 'info' ); var pages = []; var page = {}; var redirect_value = ''; $( '.results-page' ).each( function() { page = { 'conditions': [], 'page': wp.editor.getContent( $( this ).find( '.results-page-template' ).attr( 'id' ) ), 'redirect': false, }; // redirect_value = $( this ).find( '.results-page-redirect' ).val(); // if ( '' != redirect_value ) { // page.redirect = redirect_value; // } $( this ).find( '.results-page-condition' ).each( function() { page.conditions.push({ 'criteria': $( this ).children( '.results-page-condition-criteria' ).val(), 'operator': $( this ).children( '.results-page-condition-operator' ).val(), 'value': $( this ).children( '.results-page-condition-value' ).val() }); }); pages.push( page ); }); var data = { action: 'qsm_save_pages', pages: pages }; jQuery.ajax( ajaxurl, { data: data, method: 'POST', success: QSMAdmin.savePagesSuccess, error: QSMAdmin.displayjQueryError }); }
Obviously if the plugin gets updated again, this would break for me. But I thought I would bring it to the attention of the developers and for anyone else who might be experiencing the same thing.
- The topic ‘Results page’ is closed to new replies.