/** * Remove action on wp_head on LE pages */ function opCompatHeadway2013() { if (function_exists('is_le_page') && is_le_page() || defined('OP_LIVEEDITOR')) { remove_action('wp_head', 'headway_print_stylesheets', 7); remove_action('wp_head', 'headway_print_scripts', 8); } }
function remove_cherry_cookie_banner() { if (function_exists('is_le_page')) { if (is_le_page() || defined('OP_LIVEEDITOR')) { remove_action('wp_footer', 'cherry_cookie_banner', 999); } } }
function op_helpdesk_styles() { if (function_exists('is_le_page')) { if (is_le_page() || defined('OP_LIVEEDITOR')) { wp_enqueue_script('hsd'); wp_enqueue_style('hsd'); } } }
function op_fancybox_remove() { if (function_exists('is_le_page')) { if (!is_le_page() && !defined('OP_LIVEEDITOR')) { wp_dequeue_script(OP_SN . '-fancybox'); } else { wp_dequeue_script('fancybox'); } } }
function jptweak_remove_share() { if (is_le_page() || defined('OP_LIVEEDITOR')) { remove_filter('the_content', 'sharing_display', 19); remove_filter('the_excerpt', 'sharing_display', 19); if (class_exists('Jetpack_Likes')) { remove_filter('the_content', array(Jetpack_Likes::init(), 'post_likes'), 30, 1); } } }
function tc_op_dequeue_fancybox_js(){ if ( function_exists('is_le_page') ){ /* Op Back End: Dequeue tc-scripts */ if ( is_le_page() || defined('OP_LIVEEDITOR') ) { wp_dequeue_script('tc-scripts'); wp_dequeue_script('tc-fancybox'); } else { /* Front End: Dequeue Fancybox maybe already embedded in Customizr */ wp_dequeue_script('tc-fancybox'); //wp_dequeue_script(OP_SN.'-fancybox'); } } }
function op_output_css() { /* * Don't remove this, otherwise LE colour and typography settings won't work */ $css = apply_filters('op_output_css', ''); $css = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $css); $css = str_replace(array("\r\n", "\r", "\n", "\t"), '', $css); $css = str_replace(array(' {', ':', ';}'), array('{', ':', '}'), $css); if (!empty($css)) { // do not render this CSS if it is not LE page and plugin version is installed if (!is_le_page() && !defined('OP_LIVEEDITOR') && 'plugin' == OP_TYPE) { $css = ''; } echo ' <style type="text/css" id="op_header_css"> ' . $css . ' </style> '; } //Echo out custom CSS if entered $custom_css = op_default_option('custom_css'); if (!empty($custom_css)) { echo ' <style id="op_custom_css"> ' . stripslashes($custom_css) . ' </style> '; } }
/** * Remove registered CSS styles * @since 2.3.0 * @return void */ function opRemoveStyles() { /* * Not a LE page and not a LE backend, let's leave this joint */ if (false === is_le_page() && false === defined('OP_LIVEEDITOR')) { return; } $prefix = 'op_'; /* * If LE backend then modify prefix */ if (defined('OP_LIVEEDITOR')) { $prefix = 'op_le_'; } $css = op_get_option($prefix . 'external_plugins_css'); $themeCss = (int) op_get_option($prefix . 'external_theme_css'); if (is_array($css) || $themeCss) { global $wp_styles; /* * Traversing through collection of all registered styles */ foreach ($wp_styles->registered as $key => $dependency) { if (is_array($css)) { /* * Traversing through collection of "unwanted" plugins */ if (count($css) > 0) { foreach ($css as $style) { if (strpos($dependency->src, 'plugins/' . $style . '/')) { wp_deregister_style($key); } } } } /* * Deregistering theme CSS files if we are using plugin and if necessary checkbox is checked */ if (OP_TYPE === 'plugin' && $themeCss === 1 && strpos($dependency->src, '/themes/')) { wp_deregister_style($key); } } } }