wpseek.com
A WordPress-centric search engine for devs and theme authors



add_cssclass › WordPress Function

Since2.7.0
Deprecatedn/a
add_cssclass ( $class_to_add, $classes )
Parameters: (2)
  • (string) $class_to_add The CSS class to add.
    Required: Yes
  • (string) $classes The string to add the CSS class to.
    Required: Yes
Returns:
  • (string) The string with the CSS class added.
Defined at:
Codex:

Adds a CSS class to a string.



Source

function add_cssclass( $class_to_add, $classes ) {
	if ( empty( $classes ) ) {
		return $class_to_add;
	}

	return $classes . ' ' . $class_to_add;
}