add_cssclass()
Adds a CSS class to a string.
No Hooks.
Return
String
. The string with the CSS class added.
Usage
add_cssclass( $class_to_add, $classes );
- $class_to_add(string) (required)
- The CSS class to add.
- $classes(string) (required)
- The string to add the CSS class to.
Changelog
Since 2.7.0 | Introduced. |
add_cssclass() add cssclass code WP 6.6.2
function add_cssclass( $class_to_add, $classes ) { if ( empty( $classes ) ) { return $class_to_add; } return $classes . ' ' . $class_to_add; }