WC_Settings_API::get_custom_attribute_html
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 Settings API::get custom attribute html WC 10.8.1
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 );
}