Last active
April 3, 2020 07:12
-
-
Save strangerstudios/66d17b7332253df7fa4b to your computer and use it in GitHub Desktop.
Make PMPro Register Helper fields required for logged out users only.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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