Function for formatting attributes from an array?
-
Does WP (or native PHP) have a built-in function for formatting attributes from an array? For example something to the effect of:
echo attr_encode(array( 'id' => 'example' , 'class' => array('a', 'b', 'c') ));
which would output:
id="example" class="a b c"
I looked thru wp-includes/kses.php but didn’t find this exact functionality.
- The topic ‘Function for formatting attributes from an array?’ is closed to new replies.