• Resolved joaopaulopassos

    (@joaopaulopassos)


    Since CF7 is AJAX fired, as soon as the form is submitted I want to be able to grab meta-data about the newly created post via some event listener or similar.

    For CF7 itself I usually use this function

    var wpcf7Form = document.querySelector( '.wpcf7' );
    wpcf7Form.addEventListener( 'wpcf7submit', function( event ) {
        console.log( event );
    }, false );

    But it doesn’t seem like CF7_2_Posts changes that “event” variable. Is there a way to achieve this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    Post My CF7 Form is an extension that works using the action & filter hooks provided by the CF7 plugin. Therefore by definition it is activated on the server side, post submission, and does not interfere with the AJAX call on the client side.

    The Post My CF7 Form has a number of built-in action & fitler hooks that you can use on the server side to trigger your own custom code once the post is saved/created.

    If you need some custom functionality on the client-side, then I suggest you build your own ajax trigger to fetch the newly saved post upon successfully submitting your form.

    Plugin Author Aurovrata Venet

    (@aurovrata)

    assuming you have resolved your issue and marking this thread as such

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Get post information via AJAX’ is closed to new replies.