jetpack_post_details_body_classes

Adds custom classes to the array of body classes.

Description

jetpack_post_details_body_classes( $classes ); 

Parameters (1)

0. $classes
The classes.

Usage

  1. if ( !function_exists( 'jetpack_post_details_body_classes' ) ) { 
  2. require_once '/modules/theme-tools/content-options/post-details.php'; 
  3.  
  4. // The classes. 
  5. $classes = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = jetpack_post_details_body_classes($classes); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/theme-tools/content-options/post-details.php  
  1. function jetpack_post_details_body_classes( $classes ) { 
  2. // Make sure we can proceed. 
  3. list( $should_run, $options, $definied ) = jetpack_post_details_should_run(); 
  4.  
  5. if ( ! $should_run ) { 
  6. return $classes; 
  7.  
  8. list( $date_option, $categories_option, $tags_option, $author_option ) = $options; 
  9. list( $date, $categories, $tags, $author ) = $definied; 
  10.  
  11. // If date option is unticked, add a class of 'date-hidden' to the body. 
  12. if ( 1 != $date_option && ! empty( $date ) ) { 
  13. $classes[] = 'date-hidden'; 
  14.  
  15. // If categories option is unticked, add a class of 'categories-hidden' to the body. 
  16. if ( 1 != $categories_option && ! empty( $categories ) ) { 
  17. $classes[] = 'categories-hidden'; 
  18.  
  19. // If tags option is unticked, add a class of 'tags-hidden' to the body. 
  20. if ( 1 != $tags_option && ! empty( $tags ) ) { 
  21. $classes[] = 'tags-hidden'; 
  22.  
  23. // If author option is unticked, add a class of 'author-hidden' to the body. 
  24. if ( 1 != $author_option && ! empty( $author ) ) { 
  25. $classes[] = 'author-hidden'; 
  26.  
  27. return $classes;