Open dmccan opened 5 years ago
Replicated in 2.4.1.
+1
+1
Confirmed also on 3.x and 4.0 Beta
+1
+1
+1
+1
+1
Temporary fix: / Hides Google Fonts / .oxygen-select-box-option.ng-binding[ng-hide="iframeScope.globalFontExist(font.family)"],.oxygen-select-box-option.ng-binding[ng-repeat="font in iframeScope.googleFontsList | filter:iframeScope.fontsFilter | limitTo: 20"],.oxygen-select-box-option.ng-binding[ng-click="iframeScope.setComponentFont(iframeScope.component.active.id, iframeScope.component.active.name, font.family, 'font-family');"] { display: none!important; visibility: hidden!important; }
/ Hides System Fonts - Arial, Times etc. / .oxygen-select-box-option.ng-binding[ng-hide="iframeScope.globalFontExist(font)"],.oxygen-select-box-option.ng-binding[ng-repeat="font in iframeScope.webSafeFonts | filter:iframeScope.fontsFilter | limitTo: 20"],.oxygen-select-box-option.ng-binding[ng-click="iframeScope.setComponentFont(iframeScope.component.active.id, iframeScope.component.active.name, font, 'font-family"] { display: none!important; visibility: hidden!important; }
/ Hides already selected Google Fonts / .oxygen-select-box-option.ng-binding[ng-repeat="(name,font) in iframeScope.globalSettings.fonts | filter:{font:iframeScope.fontsFilter}"], .oxygen-select-box-option.ng-binding[ng-click="iframeScope.setComponentFont(iframeScope.component.active.id, iframeScope.component.active.name, ['global', name], 'font-family');"] { display: none!important; visibility: hidden!important; }
Another issue is that "Disable Google Fonts" doesn't actually remove the generated CSS
So, I have to override the font-family for "body" and heading tags with CSS.
This is the solution for this issue that I use on Yabe Webfont plugin
Expected behavior I would expect to only see web safe fonts and fonts manually added in the list.
What actually happens
Google fonts are still showing in the list
Google fonts no longer showing in the list
<?php
/*
* This file is part of the Yabe package.
*
* (c) Joshua <id@rosua.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
/**
* Disable Oxygen's built-in Google Fonts.
*/
add_filter('pre_option_oxygen_vsb_disable_google_fonts', static fn ($pre_option, $option, $default) => 'true', 1_000_001, 3);
add_filter('pre_update_option_oxygen_vsb_disable_google_fonts', static fn ($value, $old_value, $option) => 'true', 1_000_001, 3);
add_filter('pre_option_oxygen_vsb_enable_google_fonts_cache', static fn ($pre_option, $option, $default) => 'true', 1_000_001, 3);
add_filter('pre_update_option_oxygen_vsb_enable_google_fonts_cache', static fn ($value, $old_value, $option) => 'true', 1_000_001, 3);
add_filter('pre_option_oxygen_vsb_google_fonts_cache', static fn ($pre_option, $option, $default) => [[
'family' => 'Inherit',
]], 1_000_001, 3);
add_filter('pre_update_option_oxygen_vsb_google_fonts_cache', static fn ($value, $old_value, $option) => [[
'family' => 'Inherit',
]], 1_000_001, 3);
add_action('init', fn () => remove_ecf_action(), 1_000_001);
function remove_ecf_action()
{
remove_action('oxygen_enqueue_scripts', 'add_web_font');
remove_action('ct_builder_ng_init', 'ct_init_elegant_custom_fonts');
}
In the Oxygen editor Google fonts still show in the settings font list even when disabled site-wide.
I replicated the issue on a Sandbox install: http://hilarious-wombat.w5.wpsandbox.pro
Steps to reproduce the behavior:
Expected behavior I would expect to only see web safe fonts and fonts manually added in the list.
What actually happens Google fonts are still showing in the list
Desktop (please complete the following information):