Skip to content

Instantly share code, notes, and snippets.

@strangerstudios
Last active March 21, 2018 14:54
Show Gist options
  • Save strangerstudios/6e64d5d6839909471234 to your computer and use it in GitHub Desktop.
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.
<?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