2015年11月5日 星期四

Jetpack: redirect your subscribers to a Thank You web page

😊

Jetpack features a Subscriptions module that makes it straightforward on your readers to subscribe to your website, after which obtain e mail or Reader notifications for every one of many posts you publish in your website.

Your readers can use a Subscription widget to subscribe to your website. You’ll be able to see the way it appears on this very site (oh, and subscribe if you have not already ).

By default, when submitting your e mail handle into the shape, the web page reloads and success message seems as an alternative of the e-mail type. Nevertheless, beginning with Jetpack three.eight, now you can redirect your subscribers to a selected web page in your website as an alternative. It could possibly be a “Thank You” web page, it might be somewhat rationalization of what they should do to verify their subscription, … That is as much as you.

To create that redirection, you need to use the brand new jetpack_subscriptions_form_submission motion, like so:

/**
 * Redirect all profitable subscription submissions to a 'thank-you' web page
 */
perform jeherve_custom_sub_redirect_page( $outcome ) 
        if ( 'success' === $outcome ) 
                $thanks_page = 'thank-you';
                wp_safe_redirect( $thanks_page );
                exit;
        

add_action( 'jetpack_subscriptions_form_submission', 'jeherve_custom_sub_redirect_page' );

Place that code in a functionality plugin, and also you’re all set!

The post Jetpack: redirect your subscribers to a Thank You web page appeared first on DICKLEUNG DESIGN 2014.

沒有留言: