[profile_page]<\/code> shortcode provided by the plugin and you can independently identify which of the fields should be visible in the profile page.<\/p>\n\n\n\nVideo tutorial<\/h4>\n\n\n\n The plugin comes with an embeded video tutorial which comes quite handy initially to figure out how to display the custom registration form using the shortcode provided.<\/p>\n\n\n\n
Callback function for more customisation<\/h4>\n\n\n\n Recently the fully loaded commercial version of the plugin was released to the WordPress community (blessings on the author for his next life-time for this good karma \ud83d\ude42 and it comes with an additional functionality that allows for a custom field to be added to the the registration form (select type = Callback) which call a user defined function to determine the shade and content of that field. Brilliant I hear you say? Sure it is.<\/p>\n\n\n\n
How to get it to work is a little more complex to figure out since the documentation is thin if not non-existent…hence this post actually.<\/p>\n\n\n\n
When you add a new field, selete the ‘Callback’ type and in the option field, enter the name of your function, for example… echo_registration_categories<\/code> the plugin will call your function with 1 argument, the value of the field saved in the database… this is in order to ensure the field is pre-populated when loaded on the profile page for example. Here is an example,<\/p>\n\n\n\n\/\/display registration categories in sign up form\nfunction echo_registration_categories($args){\n \/\/let's get the categories for this conference\n $categories = array();\n $categories[name] = get_option(\"conf_registration_categories_name\");\n $categories[currency]= get_option(\"conf_registration_categories_currency\");\n $categories[early_bird_fees] = get_option(\"conf_registration_categories_early_bird\");\n $categories[full_fees] = get_option(\"conf_registration_categories_full\");\n \n $today = strtotime(date('d M Y'));\n $earlyDate = strtotime(get_option(\"early_bird_date\"));\n $isEarly = ($today<=$earlyDate);\n \/\/ if($text)\n $output ='<div id=\"css-user_category\" class=\"option-field radio \">';\n $output .=' <label for=\"user_category\">Registration category<span class=\"required\">*<\/span><\/label>';\n $output .=' <ul>';\n $userCategory =$args;\n if ( empty($args) && is_user_logged_in() ) {\n $user_ID = get_current_user_id();\n $userCategory = get_user_meta($user_ID, 'user_category', true);\n }\n for($idx=0; $idx < sizeof($categories[name]); $idx++){\n $checked = '';\n $text = $categories[name][$idx];\n if($text == $userCategory) $checked = 'checked';\n $cur = $categories[currency][$idx];\n $cost = $categories[full_fees][$idx];\n if( $isEarly ) $cost = $categories[early_bird_fees][$idx];\n $output .='<li><input name=\"user_category\" '.$checked.' value=\"'.$text.'\" type=\"radio\">'.$text.' <span class=\"category-cost\">'.$cost.' '.$cur.'<\/span><\/li>';\n }\n $output .=' <\/ul><\/div>';\n echo $output;\n}\n<\/code><\/pre>\n\n\n\nAs you can see, the above outputs a list of radio input<\/code> elements for a conference registration category. The user value is passed as the argument $args<\/code> when the field has a value saved in the database. I have also added a check for getting the currently logged-in user’s value in case we want to call this function separately outside the context of the plugin….and that piece of code could be left out.<\/p>\n","protected":false},"excerpt":{"rendered":"In a recent project we had to make a custom registration form with a various dynamic categories loaded on the form from which a new user can select using a radio button. Simpler Registration Form Plus We discovered the wonderful plugin which is the Swiss-army plugin for registration forms. Why do I call it the […]<\/p>\n","protected":false},"author":2,"featured_media":325,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[22],"yoast_head":"\n
Boosting Registration forms - Tiffin Consulting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n