WC_Settings_API::get_custom_attribute_html()
Get custom attributes.
Method of the class: WC_Settings_API{}
No Hooks.
Return
String
.
Usage
$WC_Settings_API = new WC_Settings_API(); $WC_Settings_API->get_custom_attribute_html( $data );
- $data(array) (required)
- Field data.
WC_Settings_API::get_custom_attribute_html() WC Settings API::get custom attribute html code WC 9.6.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 ); }