Field::get_attr( array $arr )
Description #
Convert and sanitize attributes of array to string.
Parameters #
- $arrarray (Required) Custom attributes to apply.
Source #
File: lib/form/class-field.php
protected function get_attr( $arr ) { $html = ''; if ( ! empty( $arr ) && is_array( $arr ) ) { foreach ( $arr as $attr_key => $attr_value ) { $html .= ' ' . sanitize_html_class( $attr_key ) . '="' . esc_attr( $attr_value ) . '"'; } } return $html; }
Expand full source code Collapse full source code View on GitHub: lib/form/class-field.php:509
Add your comment