Extensions/WordPress/Options/OptionsPage.php
private function set_errors( $errors )
    {
        if( count( $errors ) == 0 )
        {
            return;
        }
        
        $errors_array = array();
        foreach( $this->config->get_sections() as $section )
        {
            foreach( $section->get_fields() as $component )
            {
                if( $component instanceof \Amarkal\UI\ValidatableComponentInterface && $errors[$component->get_name()] )
                {
                    $errors_array[] = array(
                        'section'=> $section->get_slug(),
                        'message'=> $errors[$component->get_name()]
                    );
                }
            }
        }
        State::set('errors', $errors_array);
    }
private function set_errors( $errors )
    {
        if( count( $errors ) == 0 )
        {
            return;
        }
        
        $errors_array = array();
        foreach( $this->config->get_sections() as $section )
        {
            foreach( $section->get_fields() as $component )
            {
                if( $component instanceof \Amarkal\UI\ValidatableComponentInterface && $errors[$component->get_name()] )
                {
                    $errors_array[] = array(
                        'section'=> $section->get_slug(),
                        'message'=> $errors[$component->get_name()]
                    );
                }
            }
        }
        State::set('errors', $errors_array);
    }
private function set_errors ( $ errors ) { if ( count ( $ errors ) == 0 ) { return ; } $ errors_array = array ( ) ; foreach ( $ this -> config -> get_sections ( ) as $ section ) { foreach ( $ section -> get_fields ( ) as $ component ) { if ( $ component instanceof \ Amarkal \ UI \ ValidatableComponentInterface && $ errors [ $ component -> get_name ( ) ] ) { $ errors_array [ ] = array ( 'section' => $ section -> get_slug ( ) , 'message' => $ errors [ $ component -> get_name ( ) ] ) ; } } } State :: set ( 'errors' , $ errors_array ) ; }
Set the state with the given errors.

@param array $errors
Set the state with the given errors .