On this page
add_cssclass( string $class_to_add, string $classes ): string
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.
Return
string The string with the CSS class added.
Source
File: wp-admin/includes/menu.php. View all references
function add_cssclass( $class_to_add, $classes ) {
if ( empty( $classes ) ) {
return $class_to_add;
}
return $classes . ' ' . $class_to_add;
}
Related
Used By
| Used By | Description |
|---|---|
| add_menu_classes() wp-admin/includes/menu.php | Adds CSS classes for top-level administration menu items. |
Changelog
| Version | Description |
|---|---|
| 2.7.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/add_cssclass