Custom Fields
Re-Envisioned
Support MB Frontend Submission Redirect via shortcode?

  • Creator
    Topic
  • #17531
    Nick
    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #17534
    Anh 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
    Nick
    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 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 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Newsletter

Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.


grid gear info copy caret-up caret-down trash