Skip to content

Instantly share code, notes, and snippets.

@rvanweerd
Last active October 30, 2020 22:35
Show Gist options
  • Select an option

  • Save rvanweerd/2ae27152c01f0977bd74f6bcfd0ad92a to your computer and use it in GitHub Desktop.

Select an option

Save rvanweerd/2ae27152c01f0977bd74f6bcfd0ad92a to your computer and use it in GitHub Desktop.
RCP - redirect to please verify page instead of error message
function my_replace_message_with_redirect() {
$user = get_current_user_id();
if( rcp_is_pending_verification( $user ) ) {
$location = 'https://www.mysite.com/please-verify-your-email-address/';
echo("<script>location.href = '" . $location . "'</script>");
}
}
add_filter( 'rcp_restricted_message', 'my_replace_message_with_redirect', 9999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment