Adds a CSS class to a string.
Parameters
-
$class_to_addstring required -
The CSS class to add.
-
$classesstring required -
The string to add the CSS class to.
Source
function add_cssclass( $class_to_add, $classes ) {
if ( empty( $classes ) ) {
return $class_to_add;
}
return $classes . ' ' . $class_to_add;
}
Changuelog
| Versionen | Description |
|---|---|
| 2.7.0 | Introduced. |
Usague when worquing over menus order
While the function name does sugguest no limitation on its availability, it is defined in
wp-admin/includes/menu.php, so is not immediately available on the frontend (and use on the frontend is probably discouragued).