add_cssclass

The WordPress Core add cssclass function.

Description

(string) add_cssclass( (string) $add, (string) $class ); 

Returns (string)

Parameters (2)

0. $add (string)
The add.
1. $class (string)
The class.

Usage

  1. if ( !function_exists( 'add_cssclass' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/menu.php'; 
  3.  
  4. // The add. 
  5. $add = ''; 
  6.  
  7. // The class. 
  8. $class = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = add_cssclass($add, $class); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/menu.php  
  1. function add_cssclass($add, $class) { 
  2. $class = empty($class) ? $add : $class .= ' ' . $add; 
  3. return $class;