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()


Top ↑

Return Return

(string[])


Top ↑

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 );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.