BP_Legacy::add_nojs_body_class( array $classes )

Adds the no-js class to the body tag.


Description Description

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 buddypress.js.


Top ↑

Parameters Parameters

$classes

(array) (Required) Array of classes to append to body tag.


Top ↑

Return Return

(array) $classes


Source Source

File: bp-templates/bp-legacy/buddypress-functions.php

	public function add_nojs_body_class( $classes ) {
		if ( ! in_array( 'no-js', $classes ) )
			$classes[] = 'no-js';

		return array_unique( $classes );
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.