Redirect via shortcode?

Support MB Frontend Submission Redirect via shortcode?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17531
    NickNick
    Participant

    Is it possible to set a redirect via the shortcode? "[rwmb_frontend_redirect] accepts 1 parameter $config - the shortcode attributes." isn't making much sense to me.

    #17534
    Anh TranAnh Tran
    Keymaster

    Hi Nick,

    To redirect the form after submission, please put this code into your theme's functions.php file.

    add_filter( 'rwmb_frontend_redirect', function( $url, $config ) {
        if ( 'your-meta-box-id' === $config['id'] ) {
            $url = 'http://domain.com/your-url/';
        }
        return $url;
    }, 10, 2 );
    #17551
    NickNick
    Participant

    I'm using Oxygen (no functions.php) and am playing around with dynamic data impacting the redirect, so I was hoping there was just a way to do it direct in the shortcode. I guess I'll need to evaluate other options.

    #17560
    Anh TranAnh Tran
    Keymaster

    I got it. We're adding the redirect option to the shortcode, which will be available in the next version.

    In the mean time, you can use the above solution with Code Snippet plugin.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.