Plugin Directory

Changeset 3389059


Ignore:
Timestamp:
11/03/2025 05:40:54 PM (4 months ago)
Author:
chrmrtns
Message:
  • Enhancement: Fonts now visible in SafeFonts > Fonts admin page preview
Location:
safefonts
Files:
64 added
5 edited

Legend:

Unmodified
Added
Removed
  • safefonts/trunk/assets/css/fonts.css

    r3388505 r3389059  
    11/* SafeFonts - Generated CSS */
    2 /* Generated: 2025-10-30 16:54:01 */
     2/* Generated: 2025-11-03 10:58:46 */
     3
     4/* ================================= */
     5/*   FONT FACE DECLARATIONS         */
     6/* ================================= */
    37
    48@font-face {
     
    6670}
    6771
     72@font-face {
     73  font-family: 'Rock Salt';
     74  font-style: normal;
     75  font-weight: 400;
     76  font-display: swap;
     77  src: url('https://templates.idontgiveaduck.com/wp-content/uploads/safefonts/rock-salt/rock-salt-400-normal-1762158727.woff2') format('woff2');
     78}
     79
     80/* ================================= */
     81/*   GUTENBERG FONT FAMILY CLASSES  */
     82/* ================================= */
     83
     84.has-arimo-font-family {
     85  font-family: 'Arimo', sans-serif;
     86}
     87
     88.has-lato-font-family {
     89  font-family: 'Lato', sans-serif;
     90}
     91
     92.has-montserrat-font-family {
     93  font-family: 'Montserrat', sans-serif;
     94}
     95
     96.has-open-sans-font-family {
     97  font-family: 'Open Sans', sans-serif;
     98}
     99
     100.has-raleway-font-family {
     101  font-family: 'Raleway', sans-serif;
     102}
     103
     104.has-roboto-font-family {
     105  font-family: 'Roboto', sans-serif;
     106}
     107
     108.has-rock-salt-font-family {
     109  font-family: 'Rock Salt', sans-serif;
     110}
     111
  • safefonts/trunk/includes/Admin/AdminInterface.php

    r3388505 r3389059  
    113113        if (strpos($hook, 'safefonts') === false) {
    114114            return;
     115        }
     116
     117        // Enqueue fonts.css for font previews in admin
     118        $fonts_css_file = SAFEFONTS_PLUGIN_DIR . 'assets/css/fonts.css';
     119        $fonts_css_url = SAFEFONTS_PLUGIN_URL . 'assets/css/fonts.css';
     120
     121        if (file_exists($fonts_css_file)) {
     122            wp_enqueue_style(
     123                'safefonts-fonts',
     124                $fonts_css_url,
     125                array(),
     126                filemtime($fonts_css_file)
     127            );
    115128        }
    116129
  • safefonts/trunk/includes/Core.php

    r3388720 r3389059  
    8686        // Register fonts with Gutenberg editor
    8787        add_filter('block_editor_settings_all', array($this, 'register_fonts_with_editor'), 10, 2);
     88
     89        // Add fonts.css to editor styles for iframe preview
     90        add_action('after_setup_theme', array($this, 'add_editor_styles'));
    8891
    8992        // Font Library integration (WordPress 6.5+)
     
    200203
    201204        return $mimes;
     205    }
     206
     207    /**
     208     * Add fonts.css to editor styles for Gutenberg iframe preview
     209     *
     210     * @return void
     211     */
     212    public function add_editor_styles() {
     213        // Enable editor styles
     214        add_theme_support('editor-styles');
     215
     216        // Add fonts.css to editor
     217        $fonts_css_file = SAFEFONTS_PLUGIN_DIR . 'assets/css/fonts.css';
     218        $fonts_css_url = SAFEFONTS_PLUGIN_URL . 'assets/css/fonts.css';
     219
     220        if (file_exists($fonts_css_file)) {
     221            // Use full URL for add_editor_style for consistent cross-environment support
     222            add_editor_style($fonts_css_url);
     223        }
    202224    }
    203225
  • safefonts/trunk/readme.txt

    r3388720 r3389059  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.1.2
     6Stable tag: 1.1.4
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    193193
    194194== Changelog ==
     195
     196= 1.1.4 =
     197* Fix: Fonts now display correctly in Gutenberg editor iframe preview
     198* Improved: Added add_editor_style() support for block editor content area
     199* Enhancement: Fonts now visible when editing posts/pages in Gutenberg
     200
     201= 1.1.3 =
     202* Fix: Font previews now display correctly in admin area
     203* Improved: Enqueue fonts.css in admin for proper font preview rendering
     204* Enhancement: Fonts now visible in SafeFonts > Fonts admin page preview
    195205
    196206= 1.1.2 =
  • safefonts/trunk/safefonts.php

    r3388720 r3389059  
    44 * Plugin URI: https://safefonts.com
    55 * Description: Secure font management for WordPress with Gutenberg integration and local hosting for GDPR compliance.
    6  * Version: 1.1.2
     6 * Version: 1.1.4
    77 * Requires at least: 5.0
    88 * Requires PHP: 7.4
     
    2121
    2222// Define plugin constants
    23 define('SAFEFONTS_VERSION', '1.1.2');
     23define('SAFEFONTS_VERSION', '1.1.4');
    2424define('SAFEFONTS_PLUGIN_FILE', __FILE__);
    2525define('SAFEFONTS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.