Join

Redirect After Listing Submissions

Don't want to mess with code snippets? Request for this to be a feature of MyListing Pro.

Instructions

  1. Create a new PHP code snippet.
  2. Copy the contents of code snippet below.
  3. Paste the contents into your code snippet.
  4. Review any notes that I’ve provided.
  5. Save and enable the code snippet.
  6. Test.

Snippet

This snippet redirects to a custom page once a Listing is submitted and after waiting 3 seconds.

Customization Notes

  • Add your desired URL to Line 4 for the redirect.
  • Optional: Change the waiting period by adjusting the 300 value on Line 5.
add_action( 'mylisting/submission/done', function( $id ){
   ?> <script type='text/javascript'>
        setTimeout( function() {
            window.location.href='https://domain.com/custom-url';
        }, 300 );
    </script>
   <?php
}, 999, 1);