# disco/1.4.14/frontend/Extras/Body_Class.php

Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO, version 1.4.14. 46 lines.

- Page: https://pluginprobe.com/plugins/disco/1.4.14/code/frontend/Extras/Body_Class.php
- Raw: https://pluginprobe.com/plugins/disco/1.4.14/raw/frontend/Extras/Body_Class.php
- Modified: 2024-05-27T11:09:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/disco/1.4.14/code/frontend/Extras/Body_Class.php#L10-L20`.

```php
<?php
/**
 * Disco
 *
 * @package   Disco
 * @author    Ohidul Islam <wahid0003@gmail.com>
 * @copyright 2022 WebAppick
 * @license   GPL 2.0+
 * @link      http://domain.tld
 */

namespace Disco\Frontend\Extras;

use Disco\Engine\Base;

/**
 * Add custom css class to <body>
 */
class Body_Class extends Base {

    /**
	 * Initialize the class.
	 *
	 * @return void|bool
	 */
	public function initialize() {
		parent::initialize();

		\add_filter( 'disco_body_class', array( self::class, 'add_d_class' ), 10, 1 );
	}

	/**
	 * Add class in the body on the frontend
	 *
	 * @param array $classes The array with all the classes of the page.
	 * @since 1.0.0
	 * @return array
	 */
	public static function add_d_class( array $classes ) {
		$classes[] = DISCO_TEXTDOMAIN;

		return $classes;
	}

}

```
