Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. // Define the environment if we don't have one already
  2. if ( ! defined( 'WPE_ENVIRONMENT' ) ) {
  3. // Test to see if we're in staging
  4. if ( isset( $_SERVER['IS_WPE_SNAPSHOT'] ) && $_SERVER['IS_WPE_SNAPSHOT'] ) {
  5. define( 'WPE_ENVIRONMENT', 'staging' );
  6. } else {
  7. define( 'WPE_ENVIRONMENT', 'production' );
  8. }
  9. }
  10.  
  11. // Filter the body classes to add our environment
  12. function wpe_filter_body_classes( $classes ) {
  13. $classes[] = strtolower( WPE_ENVIRONMENT );
  14. return $classes;
  15. }
  16. add_filter( 'body_class', 'wpe_filter_body_classes' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement