bp_dtheme_add_nojs_body_class

Adds the no-js class to the body tag.

Description

bp_dtheme_add_nojs_body_class( $classes ); 

This function ensures that the element will have the no-js class by default. If you're using JavaScript for some visual functionality in your theme, and you want to provide noscript support, apply those styles to body.no-js.

The no-js class is removed by the JavaScript created in bp_dtheme_remove_nojs_body_class().

Parameters (1)

0. $classes
The classes.

Usage

  1. if ( !function_exists( 'bp_dtheme_add_nojs_body_class' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-themes/bp-default/functions.php'; 
  3.  
  4. // The classes. 
  5. $classes = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_dtheme_add_nojs_body_class($classes); 
  9.  

Defined (1)

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

/bp-themes/bp-default/functions.php  
  1. function bp_dtheme_add_nojs_body_class( $classes ) { 
  2. $classes[] = 'no-js'; 
  3. return array_unique( $classes );