WC_Settings_API::get_custom_attribute_html()publicWC 1.0

Get custom attributes.

Метод класса: WC_Settings_API{}

Хуков нет.

Возвращает

Строку.

Использование

$WC_Settings_API = new WC_Settings_API();
$WC_Settings_API->get_custom_attribute_html( $data );
$data(массив) (обязательный)
Field data.

Код WC_Settings_API::get_custom_attribute_html() WC 8.7.0

public function get_custom_attribute_html( $data ) {
	$custom_attributes = array();

	if ( ! empty( $data['custom_attributes'] ) && is_array( $data['custom_attributes'] ) ) {
		foreach ( $data['custom_attributes'] as $attribute => $attribute_value ) {
			$custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
		}
	}

	return implode( ' ', $custom_attributes );
}