Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active April 3, 2020 07:12
Show Gist options
  • Save strangerstudios/66d17b7332253df7fa4b to your computer and use it in GitHub Desktop.
Save strangerstudios/66d17b7332253df7fa4b to your computer and use it in GitHub Desktop.
Make PMPro Register Helper fields required for logged out users only.
if(is_user_logged_in())
$required = false;
else
$required = true;
$fields[] = new PMProRH_Field(
"company", // input name, will also be used as meta key
"text", // type of field
array(
"size"=>40, // input size
"class"=>"company", // custom class
"profile"=>true, // show in user profile
"required"=>$required // set above
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment