/** * Assembles the classes for the body element. **/ public static function body_class($c) { global $wp_query, $authordata; $c[] = 'custom'; /* User Agents */ if (!HeadwayCompiler::is_plugin_caching()) { $user_agent = $_SERVER['HTTP_USER_AGENT']; /* IE */ if ($ie_version = headway_is_ie()) { $c[] = 'ie'; $c[] = 'ie' . $ie_version; } /* Modern Browsers */ if (stripos($user_agent, 'Safari') !== false) { $c[] = 'safari'; } elseif (stripos($user_agent, 'Firefox') !== false) { $c[] = 'firefox'; } elseif (stripos($user_agent, 'Chrome') !== false) { $c[] = 'chrome'; } elseif (stripos($user_agent, 'Opera') !== false) { $c[] = 'opera'; } /* Rendering Engines */ if (stripos($user_agent, 'WebKit') !== false) { $c[] = 'webkit'; } elseif (stripos($user_agent, 'Gecko') !== false) { $c[] = 'gecko'; } /* Mobile */ if (stripos($user_agent, 'iPhone') !== false) { $c[] = 'iphone'; } elseif (stripos($user_agent, 'iPod') !== false) { $c[] = 'ipod'; } elseif (stripos($user_agent, 'iPad') !== false) { $c[] = 'ipad'; } elseif (stripos($user_agent, 'Android') !== false) { $c[] = 'android'; } } /* End User Agents */ /* Responsive Grid */ if (HeadwayResponsiveGrid::is_enabled()) { $c[] = 'responsive-grid-enabled'; } if (HeadwayResponsiveGrid::is_active()) { $c[] = 'responsive-grid-active'; } /* Pages */ if (is_page() && isset($wp_query->post) && isset($wp_query->post->ID)) { $c[] = 'pageid-' . $wp_query->post->ID; $c[] = 'page-slug-' . $wp_query->post->post_name; } /* Posts & Pages */ if (is_singular() && isset($wp_query->post) && isset($wp_query->post->ID)) { //Add the custom classes from the meta box if ($custom_css_class = HeadwayLayoutOption::get($wp_query->post->ID, 'css-class', null)) { $custom_css_classes = str_replace(' ', ' ', str_replace(',', ' ', htmlspecialchars(strip_tags($custom_css_class)))); $c = array_merge($c, array_filter(explode(' ', $custom_css_classes))); } } /* Layout IDs, etc */ $c[] = 'layout-' . HeadwayLayout::get_current(); $c[] = 'layout-using-' . HeadwayLayout::get_current_in_use(); if (HeadwayRoute::is_visual_editor_iframe()) { $c[] = 've-iframe'; } if (headway_get('ve-iframe-mode') && HeadwayRoute::is_visual_editor_iframe()) { $c[] = 'visual-editor-mode-' . headway_get('ve-iframe-mode'); } if (!current_theme_supports('headway-design-editor')) { $c[] = 'design-editor-disabled'; } $c = array_unique(array_filter($c)); return $c; }
public static function check_if_ie() { /* Only show this on IE versions less than 9 */ if (!headway_is_ie() || (headway_is_ie(9) || headway_is_ie(10) || headway_is_ie(11))) { return false; } $message = ' <span style="text-align: center;font-size: 26px;width: 100%;display: block;margin-bottom: 20px;">Error</span> Unfortunately, the Headway Visual Editor does not work with Internet Explorer due to its lack of modern features.<br /><br /> Please upgrade to a modern browser such as <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a> or <a href="http://firefox.com" target="_blank">Mozilla Firefox</a>.<br /><br /> If this message persists after upgrading to a modern browser, please visit <a href="http://support.headwaythemes.com" target="_blank">Headway Support</a>. '; return wp_die($message); }