Skip to content

Plugin download tracker JS #85

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow a post custom field of body_class (separated by spaces) to inje…
…ct classes into the body element.
  • Loading branch information
nacin committed Oct 15, 2012
commit aa2e690a03b311bf78627b5e7e1a3316fdbc774c
9 changes: 9 additions & 0 deletions mu-plugins/jquery-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ 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 ( ! $post_classes = get_post_meta( get_queried_object_id(), 'body_class', true ) )
return $classes;
return array_merge( $classes, explode( ' ', $post_classes ) );
});