Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public static function build_attributes_string( $attributes ) { |
||
10 | $string = array(); |
||
11 | foreach ( $attributes as $name => $value ) { |
||
12 | if ( '' === $value ) { |
||
13 | $string[] = sprintf( '%s', sanitize_key( $name ) ); |
||
14 | } else { |
||
15 | $string[] = sprintf( '%s="%s"', sanitize_key( $name ), esc_attr( $value ) ); |
||
16 | } |
||
17 | } |
||
18 | return implode( ' ', $string ); |
||
19 | } |
||
20 | } |
||
21 |