Skip to content

Instantly share code, notes, and snippets.

@LinzardMac
Created February 16, 2015 23:35
Show Gist options
  • Save LinzardMac/3529121636c2528bfede to your computer and use it in GitHub Desktop.
Save LinzardMac/3529121636c2528bfede to your computer and use it in GitHub Desktop.
//each call to the function has the form type in the function params
csc_show_error_messages('reg');
csc_show_error_messages('login');
csc_show_error_messages('forgot');
//set $form_type as the param
function csc_show_error_messages($form_type) {
//how do I make it so that the errors only output on the function call that has the proper form type
if($codes = csc_errors()->get_error_codes()) {
echo '<div class="csc_errors">';
// Loop error codes and display errors
foreach($codes as $code){
$message = csc_errors('forgot')->get_error_message($code);
echo '<span class="error"><strong>' . __('Error') . '</strong>: ' . $message . '</span><br/>';
}
echo '</div>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment