<?php
/**
 * <body> Functions
 */

// No direct access
if ( ! defined( 'ABSPATH' ) ) exit;

/*******************************************
 * BODY CLASSES
 *******************************************/

/**
 * Add helper classes to <body>
 *
 * IMPORTANT: Do not do client detection (mobile, browser, etc.) here.
 * Instead, do in theme's JS so works with caching plugins.
 *
 * @since 2.4
 * @param array $classes Classes currently being added to body tag
 * @return array Modified classes
 */
function risen_add_body_classes( $classes ) {

	// WordPress 4.8 or earlier (used for MediaElement.js back-compat styling)
	if ( version_compare( $GLOBALS['wp_version'], '4.8', '<=' ) ) {
		$classes[] = 'risen-wp-4-8-or-less';
	}

	return $classes;

}

add_filter( 'body_class', 'risen_add_body_classes' );
