dozent_form_errors( $echo = true )


Return

(mixed|void) Store and return form validation error


Source

File: includes/form-functions.php

    function dozent_form_errors( $echo = true )
    {

        $errors = dozent_form_errors_arr();

        $output = '';
        $error_text = sprintf( '%s' . __( 'Error:', 'dozent' ) . '%s', '<strong>', '</strong>' );
        if (is_array($errors) && count($errors)){
            $output .= '<div class="dozent-form-error-wrap"><ul class="dozent-form-error">';
            foreach ($errors as $error ){

                if ( dozent_count( $error ) ){

                    foreach ( $error as $error_item ){
                        $output .= "<li> <i class='dicon-warning'></i> {$error_text} {$error_item}</li>";
                    }

                }else{
                    $output .= "<li> <i class='dicon-warning'></i> {$error_text} {$error}</li>";
                }


            }
            $output .= '</ul></div>';
        }


        $html = apply_filters( 'dozent_form_errors_html', $output );

        if ( $echo ){
            echo $html;
        }

        return $html;

    }


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.