Remove classes from body_class()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Remove classes from body_class() | |
* | |
* @param array $wp_classes | |
* @return array | |
*/ | |
function ja_remove_body_classes( $wp_classes ) { | |
// The classes you wish to remove | |
$blacklist = array( 'reply' ); | |
// Remove classes from array | |
$wp_classes = array_diff( $wp_classes, $blacklist ); | |
// Return modified body class array | |
return $wp_classes; | |
} | |
add_filter( 'body_class', 'ja_remove_body_classes', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment