Retrieves additional HTML attributes as a string ready for inclusion in markup.

@param array $attributes Required.

@return string
629
protected function get_html_attributes( array $attributes ) {
		$html_attributes = '';
		if ( ! empty( $attributes ) ) {
			foreach ( $attributes as $attr => $val ) {
				$html_attributes .= \esc_attr( $attr ) . '="' . \esc_attr( $val ) . '" ';
			}
		}

		return $html_attributes;
	}
17448
protected function attributes($attributes)
    {
        $html = array();
        foreach ((array) $attributes as $key => $value)
        {
            $element = $this->attributeElement($key, $value);

            if ( ! is_null($element)) $html[] = $element;
        }

        $output = count($html) > 0 ? ' '.implode(' ', $html) : '';

        return trim($output);
    }
278517
public function getHashableString($attributes)
    {
        $string = null;
        if(!empty($this->hashableAttributes)) { // check if set
            foreach ($this->hashableAttributes as $value) {
                if(isset($attributes[$value])) $string .= $attributes[$value];
                else return null;
            }
        }
        return $string;
    }
1082304
public static function createAttributes($attributes = [])
    {
        $list = [];

        foreach ($attributes as $key => $value)
        {
            $list[] = sprintf('%s="%s"', $key, is_array($value) ? implode(' ', $value) : $value);
        }

        return implode(' ', $list);
    }
647021
public function datagridAttributes(array $attributes)
    {
        $result = '';

        foreach ($attributes as $attributeName => $attributeValue) {
            $result .= ' '.$attributeName.'="'.$attributeValue.'"';
        }

        return $result;
    }
1066523
private function prepareAttributes(array $attributes)
    {
        $attributes = array_merge(
            ['class' => 'g-recaptcha', 'data-sitekey' => $this->siteKey],
            array_filter($attributes)
        );

        self::checkDataAttribute($attributes, 'data-type', ['image', 'audio'], 'image');
        self::checkDataAttribute($attributes, 'data-theme', ['light', 'dark'], 'light');
        self::checkDataAttribute($attributes, 'data-size', ['normal', 'compact', 'invisible'], 'normal');
        self::checkDataAttribute($attributes, 'data-badge', ['bottomright', 'bottomleft', 'inline'], 'bottomright');

        return $attributes;
    }
454562
public function getHtml(array $attributes = []): string
    {
        return self::buildTag('input', null,
            array_merge(
                [
                    'type'     => $this->getType(),
                    'name'     => $this->getName(),
                    'value'    => $this->getText() !== '' ? $this->getText() : false,
                    'required' => $this->isRequired(),
                ],
                $attributes
            )
        );
    }
1025413
protected function parseAttributes(array $attributes)
	{
		if (isset($attributes['class'])) {
			if (is_string($attributes['class'])) {
				$attributes['class'] = explode(' ', $attributes['class']);
			}
		} else {
			$attributes['class'] = [];
		}

		return $attributes;
	}
291159
protected function generateAttrStr( $attributes = array() )
    {
        ksort( $attributes );
        $attrStr = '';
        foreach ( $attributes as $key => $val )
        {
            $attrStr .= '-' . $key . '=' .$val;
        }
        return $attrStr;
    }
1287816
public static function renderAttributes(array $attributes)
    {
        $html = [];
        foreach ($attributes as $key => $value) {
            $escaped = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
            $html[] = is_numeric($key) ?
                ($escaped . '="' . $escaped . '""')
                :
                ("$key=\"$escaped\"");
        }
        return count($html) > 0 ? ' ' . implode(' ', $html) : '';
    }
833938
public function getTemplate(array $attributes)
	{
		$this->attributes = $attributes + $this->defaultAttributes;

		return ($this->needsWrapper()) ? $this->getWrappedTemplate() : $this->getUnwrappedTemplate();
	}
935426
public function getAttributesString(array $attributes = array())
    {
        $attributesString = '';

        foreach ($attributes as $name => $values) {
            $value = is_array($values) ? implode(' ', $values) : $values;
            $attributesString .= ' '.$name.'="'.$value.'"';
        }

        return $attributesString;
    }
280413
private function getTagAttributes($attributes)
    {
        if (!$attributes) {
            return '';
        }

        $tagAttributes = '';

        foreach ($attributes as $key => $attribute) {
            $tagAttributes .= ' ' . $key . '="' . $attribute . '"';
        }

        return $tagAttributes;
    }
424191
public function decorateOuterElement($html, $attributes)
    {
        if (! $html) {
            return $html;
        }

        $htmlAttr = [];
        foreach ($attributes as $key => $value) {
            $htmlAttr[] = sprintf('%s="%s"', $key, htmlspecialchars($value));
        }
        $htmlAttr = implode(' ', $htmlAttr);

        $html = preg_replace(
            '/(<\b[^><]*)>/i',
            '$1'.($htmlAttr ? ' '.$htmlAttr : '').'>',
            $html,
            1
        );

        return $html;
    }
538652
public function attributes(array $attributes)
        {
            $this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));

            return $this;
        }
26168
protected static function attribute($attributes = [])
	{
		$text = '';
		foreach ($attributes as $option => $value) {
			$text = ' ' . $option . '="' . $value . '"';
		}
		return $text;
	}
85196
public function getHtml(array $attributes = []): string
    {
        return self::buildTag('input', null,
            array_merge(
                [
                    'type'    => 'radio',
                    'name'    => $this->name !== '' ? $this->name : false,
                    'value'   => $this->value,
                    'checked' => $this->isSelected,
                ],
                $attributes
            )
        );
    }