diff --git a/mu-plugins/jquery-filters.php b/mu-plugins/jquery-filters.php index 80ddb693..724d27c4 100644 --- a/mu-plugins/jquery-filters.php +++ b/mu-plugins/jquery-filters.php @@ -59,3 +59,14 @@ function jquery_unfiltered_html_for_term_descriptions() { // Bypass multisite checks. add_filter( 'ms_site_check', '__return_true' ); + +// Add body classes found in postmeta. +add_filter( 'body_class', function( $classes ) { + if ( ! is_singular() ) + return $classes; + if ( is_page() ) + $classes[] = 'page-slug-' . sanitize_html_class( strtolower( get_queried_object()->post_name ) ); + if ( $post_classes = get_post_meta( get_queried_object_id(), 'body_class', true ) ) + $classes = array_merge( $classes, explode( ' ', $post_classes ) ); + return $classes; +}); diff --git a/themes/jquery.org/functions.php b/themes/jquery.org/functions.php index 32c83d45..df3b7cdd 100644 --- a/themes/jquery.org/functions.php +++ b/themes/jquery.org/functions.php @@ -1,4 +1,4 @@ - -
+