styles-fix.php
32 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Fix admin styles & TinyMCE editor |
| 4 | * |
| 5 | * @author Mobin Ghasempoor |
| 6 | * @package WP-Parsidate |
| 7 | * @subpackage Admin/Styles |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Fixes themes and plugins RTL style, they should be LTR |
| 12 | * |
| 13 | * @since 2.0 |
| 14 | * @return void |
| 15 | */ |
| 16 | function wpp_fix_editor_rtl() { |
| 17 | wp_enqueue_style( 'functions', WP_PARSI_URL . 'assets/css/admin-fix.css', false, WP_PARSI_VER, 'all' ); |
| 18 | } |
| 19 | add_action( 'admin_print_styles-plugin-editor.php', 'wpp_fix_editor_rtl', 10 ); |
| 20 | add_action( 'admin_print_styles-theme-editor.php', 'wpp_fix_editor_rtl', 10 ); |
| 21 | |
| 22 | /** |
| 23 | * Fixes TinyMCE font |
| 24 | * |
| 25 | * @since 2.0 |
| 26 | * @return void |
| 27 | */ |
| 28 | function wpp_fix_tinymce_font() { |
| 29 | add_editor_style( WP_PARSI_URL . 'assets/css/editor.css' ); |
| 30 | } |
| 31 | add_filter( 'init', 'wpp_fix_tinymce_font', 9 ); |
| 32 |