Last active
March 21, 2018 14:54
-
-
Save strangerstudios/6e64d5d6839909471234 to your computer and use it in GitHub Desktop.
Example of how to show a field at checkout for addon packages only.
This file contains hidden or 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
<?php | |
/* | |
This field is for addon packages only. | |
*/ | |
if(!empty($_REQUEST['ap'])) //might want to also look up ap to see if it's active/etc | |
$profile = true; | |
else | |
$profile = 'only_admin'; | |
$fields[] = new PMProRH_Field( | |
"student", // input name, will also be used as meta key | |
"text", // type of field | |
array( | |
"levels"=>array(2,3,4,5), | |
"size"=>40, // input size | |
"class"=>"student", // custom class | |
"profile"=>$profile, // show in user profile | |
"required"=>true, // make this field required | |
"memberslistcsv"=>true | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment