edd_add_body_classes

Adds body classes for EDD pages.

Description

(array) edd_add_body_classes( (array) $class ); 

Returns (array)

Modified array of classes

Parameters (1)

0. $class (array)
Current classes

Usage

  1. if ( !function_exists( 'edd_add_body_classes' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'easy-digital-downloads/includes/template-functions.php'; 
  3.  
  4. // current classes 
  5. $class = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = edd_add_body_classes($class); 
  9.  

Defined (1)

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

/includes/template-functions.php  
  1. function edd_add_body_classes( $class ) { 
  2. $classes = (array) $class; 
  3.  
  4. if( edd_is_checkout() ) { 
  5. $classes[] = 'edd-checkout'; 
  6. $classes[] = 'edd-page'; 
  7.  
  8. if( edd_is_success_page() ) { 
  9. $classes[] = 'edd-success'; 
  10. $classes[] = 'edd-page'; 
  11.  
  12. $classes[] = 'edd-failed-transaction'; 
  13. $classes[] = 'edd-page'; 
  14.  
  15. $classes[] = 'edd-purchase-history'; 
  16. $classes[] = 'edd-page'; 
  17.  
  18. if( edd_is_test_mode() ) { 
  19. $classes[] = 'edd-test-mode'; 
  20.  
  21. return array_unique( $classes );