/** * Called to validate registration form field * @return string */ public static function validate_registration_form($id = null, $redirect = null) { // if registration form have been submitted process it // filter to change registration submit button name to avoid validation for forms on same page $submit_name = apply_filters('pp_registration_submit_name', 'reg_submit', $id); if (isset($_POST[$submit_name])) { $register_the_user = ProfilePress_Registration_Auth::register_new_user($_POST, $id, $_FILES, $redirect); } // display form generated messages if (!empty($register_the_user)) { $registration_errors = html_entity_decode($register_the_user); } else { $registration_errors = ''; } return $registration_errors; }