From 92f89a3bc53cb3ef1442aef41842f41fa81708d2 Mon Sep 17 00:00:00 2001 From: DediData <33499600+Dedi-Data@users.noreply.github.com> Date: Wed, 18 May 2022 17:00:19 +0430 Subject: [PATCH] Fix for loading Vazir font in block editor When we don't select Vazir font and we enable editor styles in theme: add_theme_support( 'editor-styles' ); The plugin loads Vazir font in Block editor and changes font sizes and font family So this fix ensures which Vazir font loads only when we select the option in plugins settings --- includes/admin/styles-fix.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/admin/styles-fix.php b/includes/admin/styles-fix.php index 4aa5d96..b693136 100644 --- a/includes/admin/styles-fix.php +++ b/includes/admin/styles-fix.php @@ -32,9 +32,10 @@ function wpp_fix_editor_rtl() { * @since 2.0 */ function wpp_fix_tinymce_font() { + if( wpp_is_active( 'enable_fonts' ) ){ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || wpp_is_active( 'dev_mode' ) ? '' : '.min'; - add_editor_style( WP_PARSI_URL . "assets/css/editor$suffix.css" ); + } } -add_filter( 'init', 'wpp_fix_tinymce_font', 9 ); \ No newline at end of file +add_filter( 'init', 'wpp_fix_tinymce_font', 9 );