Themosis\Field\Fields\FieldBuilder::parseAttributes PHP Method

parseAttributes() protected method

Parse and prepare the field tag attributes.
protected parseAttributes ( ) : array
return array The parsed attributes.
    protected function parseAttributes()
    {
        $atts = $this['atts'];
        // Check if developer has defined a custom name attribute.
        // If so, remove it.
        if (isset($atts['name'])) {
            unset($atts['name']);
        }
        // Set the 'id' attribute.
        $atts['id'] = isset($atts['id']) ? $atts['id'] : $this['name'] . '-id';
        // Set the 'class' attribute.
        $atts['class'] = isset($atts['class']) ? $atts['class'] : 'field-' . $this['name'];
        return $atts;
    }