Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save nextab/7dfcfecde0a540c8cce219aabfdb9abd to your computer and use it in GitHub Desktop.

Select an option

Save nextab/7dfcfecde0a540c8cce219aabfdb9abd to your computer and use it in GitHub Desktop.
#region Check Activation Code
/**
*
* @param $value mixed
* @param $context \Jet_Form_Builder\Request\Parser_Context
*
* @return bool
*/
function jet_fb_v_activation_code_check( $value, $context ): bool {
$user = wp_get_current_user();
if (!( $user && 'WP_User' === get_class( $user ) )) return false;
$user_email = $user->user_email;
if(get_jet_field('activation_code', $user_email) == $value) return true;
return false;
}
#endregion Check Activation Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment