wordpress / latest / functions / add_cssclass.html

add_cssclass( string $class_to_add, string $classes ): string

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. View all references

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

	return $classes . ' ' . $class_to_add;
}

Used By

Used By Description

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