LLMS_Form_Field::classes_ensure_array( string[]|string $classes, string[] $defaults = array() )
Merge an array of classes into a string or array of classes
Parameters Parameters
- $classes
-
(string[]|string) (Required) Classes.
- $defaults
-
(string[]) (Optional) Default classes.
Default value: array()
Return Return
(string[])
Source Source
File: includes/forms/class-llms-form-field.php
protected function classes_ensure_array( $classes, $defaults = array() ) { if ( is_string( $classes ) ) { $classes = array_map( 'esc_attr', array_map( 'trim', explode( ' ', $classes ) ) ); } $classes = array_merge( $defaults, $classes ); return array_filter( $classes ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
5.0.0 | Introduced. |