add_cssclass() wordpress function and usage

Home / WordPress / WordPress Wiki / add_cssclass() wordpress function and usage

add_cssclass( string $add, string $class )

Parameters

$add

(string) (Required)

$class

(string) (Required)

Return

(string)

Sample Usage

Usage when working over menus order

$firstm = $lastm = false;
$i = 0;
 
foreach ( $menu as $order => $top ) {
        $i++;
 
        if ( 0 == $order ) {
            $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] );
            $lastm = 0;
            continue;
        }

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments