add_cssclass( string $class_to_add, string $classes )
Adds a CSS class to a string.
Parameters
- $class_to_add
-
(string) (Required) The CSS class to add.
- $classes
-
(string) (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
function add_cssclass( $class_to_add, $classes ) { if ( empty( $classes ) ) { return $class_to_add; } return $classes . ' ' . $class_to_add; }
Expand full source code Collapse full source code View on Trac View on GitHub
Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Usage when working over menus order
Expand full source codeCollapse full source code
While the function name does suggest 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 discouraged).