php - issue on printing woocommerce notices after user registration redirect -
i'm playing filter (woocommerce_registration_redirect
) log out user after registeration , show temporary message.
here's i've done
add_filter( 'woocommerce_registration_redirect', 'redirect_after_register' ); function redirect_after_register() { wp_logout(); wc_add_notice( __( 'some message', 'woocommerce' ), "notice" ); return wc_get_page_permalink( 'myaccount' ); }
after user registration, redirect him account page, wc_print_notices()
must display custom notice message. unfortunately, doesn't' work , message doesn't appear.
can on this?
you're trying message appear after re-direct, correct? code seems add notice page before redirect. have devise mechanism fire function after re-direct happens. same problem faced try upon plugin activation. can use same solution in codex:
https://codex.wordpress.org/function_reference/register_activation_hook
Comments
Post a Comment