src/Page/Page.php
public function getSettingError(string $name): array
    {
        $errors = get_settings_errors($this->getSlug());

        if (empty($errors)) {
            return [];
        }

        return collect($errors)->first(function ($error) use ($name) {
            return $error['code'] === $name;
        });
    }
public function getSettingError(string $name): array
    {
        $errors = get_settings_errors($this->getSlug());

        if (empty($errors)) {
            return [];
        }

        return collect($errors)->first(function ($error) use ($name) {
            return $error['code'] === $name;
        });
    }
public function getSettingError ( string $ name ) : array { $ errors = get_settings_errors ( $ this -> getSlug ( ) ) ; if ( empty ( $ errors ) ) { return [ ] ; } return collect ( $ errors ) -> first ( function ( $ error ) use ( $ name ) { return $ error [ 'code' ] === $ name ; } ) ; }
Return the setting error from its name.

@param string $name

@return array
Return the setting error from its name .