src/WPametu/UI/Field/Text.php
protected function length_helper($data){
	    if ( ($this->min || $this->max) && $this->length_helper ){
            $notice = [];
            $class_name = 'ok';
            if( $this->min ){
                $notice[] = sprintf($this->__('%s chars or more'), number_format($this->min));
                if( $this->min > mb_strlen($data, 'utf-8') ){
                    $class_name = 'ng';
                }
            }
            if( $this->max ){
                $notice[] = sprintf($this->__('%s chars or less'), number_format($this->max));
                if( $this->max < mb_strlen($data, 'utf-8') ){
                    $class_name = 'ng';
                }
            }

            return sprintf('<p class="char-counter %s"><i class="dashicons"></i> <strong>%s</strong><span> %s</span><small>%s</small></p>',
                $class_name, mb_strlen($data, 'utf-8'), $this->__('Letters'), implode(', ', $notice));
        }else{
            return '';
        }
    }
protected function length_helper($data){
	    if ( ($this->min || $this->max) && $this->length_helper ){
            $notice = [];
            $class_name = 'ok';
            if( $this->min ){
                $notice[] = sprintf($this->__('%s chars or more'), number_format($this->min));
                if( $this->min > mb_strlen($data, 'utf-8') ){
                    $class_name = 'ng';
                }
            }
            if( $this->max ){
                $notice[] = sprintf($this->__('%s chars or less'), number_format($this->max));
                if( $this->max < mb_strlen($data, 'utf-8') ){
                    $class_name = 'ng';
                }
            }

            return sprintf('<p class="char-counter %s"><i class="dashicons"></i> <strong>%s</strong><span> %s</span><small>%s</small></p>',
                $class_name, mb_strlen($data, 'utf-8'), $this->__('Letters'), implode(', ', $notice));
        }else{
            return '';
        }
    }
protected function length_helper ( $ data ) { if ( ( $ this -> min || $ this -> max ) && $ this -> length_helper ) { $ notice = [ ] ; $ class_name = 'ok' ; if ( $ this -> min ) { $ notice [ ] = sprintf ( $ this -> __ ( '%s chars or more' ) , number_format ( $ this -> min ) ) ; if ( $ this -> min > mb_strlen ( $ data , 'utf-8' ) ) { $ class_name = 'ng' ; } } if ( $ this -> max ) { $ notice [ ] = sprintf ( $ this -> __ ( '%s chars or less' ) , number_format ( $ this -> max ) ) ; if ( $ this -> max < mb_strlen ( $ data , 'utf-8' ) ) { $ class_name = 'ng' ; } } return sprintf ( '<p class="char-counter %s"><i class="dashicons"></i> <strong>%s</strong><span> %s</span><small>%s</small></p>' , $ class_name , mb_strlen ( $ data , 'utf-8' ) , $ this -> __ ( 'Letters' ) , implode ( ', ' , $ notice ) ) ; } else { return '' ; } }
Returns length helper

@param string $data
@return string
Returns length helper