Plugin Directory

Changeset 3254070


Ignore:
Timestamp:
03/11/2025 01:07:58 PM (11 months ago)
Author:
DannyCooper
Message:

Update to version 3.9.2 from GitHub

Location:
olympus-google-fonts
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • olympus-google-fonts/tags/3.9.2/assets/css/customize-controls.css

    r2801985 r3254070  
    77#customize-theme-controls #sub-accordion-section-ogf_theme,
    88#customize-theme-controls #sub-accordion-section-ogf_woocommerce,
     9#customize-theme-controls #sub-accordion-section-ogf_elementor,
    910#customize-theme-controls #sub-accordion-section-ogf_wc_shop,
    1011#customize-theme-controls #sub-accordion-section-ogf_wc_single,
     
    2829
    2930#customize-control-ogf_headings_typography .typography-font-size,
    30 #customize-control-ogf_headings_typography .typography-line-height {
     31#customize-control-ogf_headings_typography .typography-line-height,
     32#customize-control-ogf_elementor_heading_typography .typography-font-size,
     33#customize-control-ogf_elementor_heading_typography .typography-line-height {
    3134    display: none;
    3235}
  • olympus-google-fonts/tags/3.9.2/assets/js/customize-controls.js

    r3100693 r3254070  
    237237
    238238                    // Make sure our manual input value doesn't exceed the minimum & maxmium values
    239                     if ( resetValue < sliderMinValue ) {
     239                    if ( resetValue && resetValue < sliderMinValue ) {
    240240                        resetValue = sliderMinValue;
    241241                        jQuery( this ).val( resetValue );
    242242                    }
    243                     if ( resetValue > sliderMaxValue ) {
     243                    if ( resetValue && resetValue > sliderMaxValue ) {
    244244                        resetValue = sliderMaxValue;
    245245                        jQuery( this ).val( resetValue );
    246246                    }
     247
    247248                    jQuery( this ).parent().find( '.slider' ).slider( 'value', resetValue );
    248249                } );
  • olympus-google-fonts/tags/3.9.2/changelog.txt

    r3243818 r3254070  
     1= 3.9.2 =
     2
     3* Add control panel for Elementor (headings/buttons)
     4
    15= 3.9.1 =
    26
  • olympus-google-fonts/tags/3.9.2/class-olympus-google-fonts.php

    r3243818 r3254070  
    3939    public function constants() {
    4040        if ( ! defined( 'OGF_VERSION' ) ) {
    41             define( 'OGF_VERSION', '3.9.1' );
     41            define( 'OGF_VERSION', '3.9.2' );
    4242        }
    4343
  • olympus-google-fonts/tags/3.9.2/compatibility/elementor.php

    r3221683 r3254070  
    1111 * Create a new group for fonts added by Fonts Plugin.
    1212 */
    13 add_filter( 'elementor/fonts/groups', function($groups) {
    14     return array_merge(['fontsplugin' => 'Fonts Plugin'], $groups);
    15 }, 10, 1 );
     13add_filter(
     14    'elementor/fonts/groups',
     15    function ( $groups ) {
     16        return array_merge( array( 'fontsplugin' => 'Fonts Plugin' ), $groups );
     17    },
     18    10,
     19    1
     20);
    1621
    1722/**
    1823 * Add fonts from Typekit and uploaded fonts to the Elementor dropdown.
    1924 */
    20 add_filter( 'elementor/fonts/additional_fonts', function($fonts) {
    21     $custom_fonts = ogf_custom_fonts_unique();
    22    
    23     foreach( $custom_fonts as $key => $value ) {
    24         $fonts[$key] = 'fontsplugin';
    25     }
     25add_filter(
     26    'elementor/fonts/additional_fonts',
     27    function ( $fonts ) {
     28        $custom_fonts = ogf_custom_fonts_unique();
    2629
    27     $typekit_fonts = ogf_typekit_fonts();
     30        foreach ( $custom_fonts as $key => $value ) {
     31            $fonts[ $key ] = 'fontsplugin';
     32        }
    2833
    29     foreach( $typekit_fonts as $key => $value ) {
    30         $fonts[$value['id']] = 'fontsplugin';
    31     }
     34        $typekit_fonts = ogf_typekit_fonts();
    3235
    33     return $fonts;
    34 }, 10, 1 );
     36        foreach ( $typekit_fonts as $key => $value ) {
     37            $fonts[ $value['id'] ] = 'fontsplugin';
     38        }
     39
     40        return $fonts;
     41    },
     42    10,
     43    1
     44);
     45
     46/**
     47 * Modify the default element selectors to improve compatibility with Elementor.
     48 *
     49 * @param array $elements The default elements.
     50 */
     51function ogf_elementor_controls( $elements ) {
     52    $new = array(
     53        'ogf_elementor_heading' => array(
     54            'label'       => esc_html__( 'Elementor Heading Typography', 'olympus-google-fonts' ),
     55            'description' => '',
     56            'section'     => 'ogf_elementor',
     57            'selectors'   => '.elementor-page .elementor-heading-title',
     58        ),
     59        'ogf_elementor_button'  => array(
     60            'label'       => esc_html__( 'Elementor Button Typography', 'olympus-google-fonts' ),
     61            'description' => '',
     62            'section'     => 'ogf_elementor',
     63            'selectors'   => '.elementor-page .elementor-button-link',
     64        ),
     65    );
     66
     67    return array_merge( $elements, $new );
     68}
     69add_filter( 'ogf_elements', 'ogf_elementor_controls' );
  • olympus-google-fonts/tags/3.9.2/includes/customizer/output-css.php

    r3221683 r3254070  
    205205function ogf_build_font_stack( $font_id ) {
    206206
     207    // Try to get cached font stack first.
     208    $cache_key    = 'ogf_font_stack_' . md5( $font_id );
     209    $cached_stack = wp_cache_get( $cache_key );
     210   
     211    if ( $cached_stack !== false ) {
     212        return $cached_stack;
     213    }
     214
     215    // Initialize stack.
    207216    $stack = '';
    208217
     
    240249    }
    241250
     251    // Cache the result.
     252    wp_cache_set( $cache_key, $stack, 'ogf_font_stacks', HOUR_IN_SECONDS );
     253   
     254    // Allow filtering of the final stack.
    242255    return apply_filters( "ogf_{$font_id}_stack", $stack );
    243256}
  • olympus-google-fonts/tags/3.9.2/includes/customizer/panels.php

    r3114877 r3254070  
    213213    }
    214214
    215     if ( ogf_is_memberpress_courses_activated() ) {
     215    if ( ogf_is_elementor_activated() ) {
    216216        $ogf_memberspress_courses_panel = new OGF_Customize_Panel(
    217217            $wp_customize,
     
    226226
    227227        $wp_customize->add_section(
    228             'ogf_memberpress_courses',
     228            'ogf_elementor',
    229229            array(
    230230                'title' => esc_html__( 'MemberPress Courses', 'olympus-google-fonts' ),
    231231                'panel' => 'ogf_memberpress',
     232            )
     233        );
     234    }
     235
     236    if ( ogf_is_elementor_activated() ) {
     237
     238        $wp_customize->add_section(
     239            'ogf_elementor',
     240            array(
     241                'title'       => esc_html__( 'Elementor', 'olympus-google-fonts' ),
     242                'description' => __( 'These styles only apply to elements added using the Elementor plugin.', 'olympus-google-fonts' ),
     243                'panel'       => 'ogf_google_fonts',
    232244            )
    233245        );
  • olympus-google-fonts/tags/3.9.2/includes/functions.php

    r3115036 r3254070  
    161161 */
    162162function ogf_fonts_array() {
    163     $fonts = array();
     163    static $fonts = array();
     164
     165    if ( ! empty( $fonts ) ) {
     166        return $fonts;
     167    }
    164168
    165169    $fonts_json = file_get_contents( OGF_DIR_PATH . '/blocks/src/google-fonts/fonts.json' );
     
    432436
    433437/**
     438 * Check if MemberPress Courses is activated.
     439 */
     440function ogf_is_elementor_activated() {
     441    if ( defined( 'ELEMENTOR_VERSION' ) ) {
     442        return true;
     443    }
     444    return false;
     445}
     446
     447/**
    434448 * Check if Fonts Plugin Pro is activated.
    435449 */
  • olympus-google-fonts/tags/3.9.2/includes/gutenberg/output-css.php

    r3100693 r3254070  
    4444add_action( 'admin_head', 'ogf_gutenberg_output_css' );
    4545
     46/**
     47 * Build the CSS rules for the Gutenberg editor.
     48 *
     49 * @return string The compiled CSS rules.
     50 */
    4651function ogf_gutenberg_build_css() {
    4752    $elements = array(
  • olympus-google-fonts/tags/3.9.2/olympus-google-fonts.php

    r3243818 r3254070  
    66 * Plugin URI:  https://wordpress.org/plugins/olympus-google-fonts/
    77 * Description: The easiest to customize fonts in WordPress. Optimized for Speed. 1000+ font choices. Supports Google Fonts, Adobe Fonts and Upload Fonts.
    8  * Version:     3.9.1
     8 * Version:     3.9.2
    99 * Author:      Fonts Plugin
    1010 * Author URI:  https://fontsplugin.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description
  • olympus-google-fonts/tags/3.9.2/readme.txt

    r3243818 r3254070  
    66Tested up to: 6.7
    77License: GPLv2 or later
    8 Stable tag: 3.9.1
     8Stable tag: 3.9.2
    99
    1010The easiest to customize fonts in WordPress. Optimized for Speed. 1000+ font choices. Supports Google Fonts, Adobe Fonts and Upload Fonts.
  • olympus-google-fonts/trunk/assets/css/customize-controls.css

    r2801985 r3254070  
    77#customize-theme-controls #sub-accordion-section-ogf_theme,
    88#customize-theme-controls #sub-accordion-section-ogf_woocommerce,
     9#customize-theme-controls #sub-accordion-section-ogf_elementor,
    910#customize-theme-controls #sub-accordion-section-ogf_wc_shop,
    1011#customize-theme-controls #sub-accordion-section-ogf_wc_single,
     
    2829
    2930#customize-control-ogf_headings_typography .typography-font-size,
    30 #customize-control-ogf_headings_typography .typography-line-height {
     31#customize-control-ogf_headings_typography .typography-line-height,
     32#customize-control-ogf_elementor_heading_typography .typography-font-size,
     33#customize-control-ogf_elementor_heading_typography .typography-line-height {
    3134    display: none;
    3235}
  • olympus-google-fonts/trunk/assets/js/customize-controls.js

    r3100693 r3254070  
    237237
    238238                    // Make sure our manual input value doesn't exceed the minimum & maxmium values
    239                     if ( resetValue < sliderMinValue ) {
     239                    if ( resetValue && resetValue < sliderMinValue ) {
    240240                        resetValue = sliderMinValue;
    241241                        jQuery( this ).val( resetValue );
    242242                    }
    243                     if ( resetValue > sliderMaxValue ) {
     243                    if ( resetValue && resetValue > sliderMaxValue ) {
    244244                        resetValue = sliderMaxValue;
    245245                        jQuery( this ).val( resetValue );
    246246                    }
     247
    247248                    jQuery( this ).parent().find( '.slider' ).slider( 'value', resetValue );
    248249                } );
  • olympus-google-fonts/trunk/changelog.txt

    r3243818 r3254070  
     1= 3.9.2 =
     2
     3* Add control panel for Elementor (headings/buttons)
     4
    15= 3.9.1 =
    26
  • olympus-google-fonts/trunk/class-olympus-google-fonts.php

    r3243818 r3254070  
    3939    public function constants() {
    4040        if ( ! defined( 'OGF_VERSION' ) ) {
    41             define( 'OGF_VERSION', '3.9.1' );
     41            define( 'OGF_VERSION', '3.9.2' );
    4242        }
    4343
  • olympus-google-fonts/trunk/compatibility/elementor.php

    r3221683 r3254070  
    1111 * Create a new group for fonts added by Fonts Plugin.
    1212 */
    13 add_filter( 'elementor/fonts/groups', function($groups) {
    14     return array_merge(['fontsplugin' => 'Fonts Plugin'], $groups);
    15 }, 10, 1 );
     13add_filter(
     14    'elementor/fonts/groups',
     15    function ( $groups ) {
     16        return array_merge( array( 'fontsplugin' => 'Fonts Plugin' ), $groups );
     17    },
     18    10,
     19    1
     20);
    1621
    1722/**
    1823 * Add fonts from Typekit and uploaded fonts to the Elementor dropdown.
    1924 */
    20 add_filter( 'elementor/fonts/additional_fonts', function($fonts) {
    21     $custom_fonts = ogf_custom_fonts_unique();
    22    
    23     foreach( $custom_fonts as $key => $value ) {
    24         $fonts[$key] = 'fontsplugin';
    25     }
     25add_filter(
     26    'elementor/fonts/additional_fonts',
     27    function ( $fonts ) {
     28        $custom_fonts = ogf_custom_fonts_unique();
    2629
    27     $typekit_fonts = ogf_typekit_fonts();
     30        foreach ( $custom_fonts as $key => $value ) {
     31            $fonts[ $key ] = 'fontsplugin';
     32        }
    2833
    29     foreach( $typekit_fonts as $key => $value ) {
    30         $fonts[$value['id']] = 'fontsplugin';
    31     }
     34        $typekit_fonts = ogf_typekit_fonts();
    3235
    33     return $fonts;
    34 }, 10, 1 );
     36        foreach ( $typekit_fonts as $key => $value ) {
     37            $fonts[ $value['id'] ] = 'fontsplugin';
     38        }
     39
     40        return $fonts;
     41    },
     42    10,
     43    1
     44);
     45
     46/**
     47 * Modify the default element selectors to improve compatibility with Elementor.
     48 *
     49 * @param array $elements The default elements.
     50 */
     51function ogf_elementor_controls( $elements ) {
     52    $new = array(
     53        'ogf_elementor_heading' => array(
     54            'label'       => esc_html__( 'Elementor Heading Typography', 'olympus-google-fonts' ),
     55            'description' => '',
     56            'section'     => 'ogf_elementor',
     57            'selectors'   => '.elementor-page .elementor-heading-title',
     58        ),
     59        'ogf_elementor_button'  => array(
     60            'label'       => esc_html__( 'Elementor Button Typography', 'olympus-google-fonts' ),
     61            'description' => '',
     62            'section'     => 'ogf_elementor',
     63            'selectors'   => '.elementor-page .elementor-button-link',
     64        ),
     65    );
     66
     67    return array_merge( $elements, $new );
     68}
     69add_filter( 'ogf_elements', 'ogf_elementor_controls' );
  • olympus-google-fonts/trunk/includes/customizer/output-css.php

    r3221683 r3254070  
    205205function ogf_build_font_stack( $font_id ) {
    206206
     207    // Try to get cached font stack first.
     208    $cache_key    = 'ogf_font_stack_' . md5( $font_id );
     209    $cached_stack = wp_cache_get( $cache_key );
     210   
     211    if ( $cached_stack !== false ) {
     212        return $cached_stack;
     213    }
     214
     215    // Initialize stack.
    207216    $stack = '';
    208217
     
    240249    }
    241250
     251    // Cache the result.
     252    wp_cache_set( $cache_key, $stack, 'ogf_font_stacks', HOUR_IN_SECONDS );
     253   
     254    // Allow filtering of the final stack.
    242255    return apply_filters( "ogf_{$font_id}_stack", $stack );
    243256}
  • olympus-google-fonts/trunk/includes/customizer/panels.php

    r3114877 r3254070  
    213213    }
    214214
    215     if ( ogf_is_memberpress_courses_activated() ) {
     215    if ( ogf_is_elementor_activated() ) {
    216216        $ogf_memberspress_courses_panel = new OGF_Customize_Panel(
    217217            $wp_customize,
     
    226226
    227227        $wp_customize->add_section(
    228             'ogf_memberpress_courses',
     228            'ogf_elementor',
    229229            array(
    230230                'title' => esc_html__( 'MemberPress Courses', 'olympus-google-fonts' ),
    231231                'panel' => 'ogf_memberpress',
     232            )
     233        );
     234    }
     235
     236    if ( ogf_is_elementor_activated() ) {
     237
     238        $wp_customize->add_section(
     239            'ogf_elementor',
     240            array(
     241                'title'       => esc_html__( 'Elementor', 'olympus-google-fonts' ),
     242                'description' => __( 'These styles only apply to elements added using the Elementor plugin.', 'olympus-google-fonts' ),
     243                'panel'       => 'ogf_google_fonts',
    232244            )
    233245        );
  • olympus-google-fonts/trunk/includes/functions.php

    r3115036 r3254070  
    161161 */
    162162function ogf_fonts_array() {
    163     $fonts = array();
     163    static $fonts = array();
     164
     165    if ( ! empty( $fonts ) ) {
     166        return $fonts;
     167    }
    164168
    165169    $fonts_json = file_get_contents( OGF_DIR_PATH . '/blocks/src/google-fonts/fonts.json' );
     
    432436
    433437/**
     438 * Check if MemberPress Courses is activated.
     439 */
     440function ogf_is_elementor_activated() {
     441    if ( defined( 'ELEMENTOR_VERSION' ) ) {
     442        return true;
     443    }
     444    return false;
     445}
     446
     447/**
    434448 * Check if Fonts Plugin Pro is activated.
    435449 */
  • olympus-google-fonts/trunk/includes/gutenberg/output-css.php

    r3100693 r3254070  
    4444add_action( 'admin_head', 'ogf_gutenberg_output_css' );
    4545
     46/**
     47 * Build the CSS rules for the Gutenberg editor.
     48 *
     49 * @return string The compiled CSS rules.
     50 */
    4651function ogf_gutenberg_build_css() {
    4752    $elements = array(
  • olympus-google-fonts/trunk/olympus-google-fonts.php

    r3243818 r3254070  
    66 * Plugin URI:  https://wordpress.org/plugins/olympus-google-fonts/
    77 * Description: The easiest to customize fonts in WordPress. Optimized for Speed. 1000+ font choices. Supports Google Fonts, Adobe Fonts and Upload Fonts.
    8  * Version:     3.9.1
     8 * Version:     3.9.2
    99 * Author:      Fonts Plugin
    1010 * Author URI:  https://fontsplugin.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description
  • olympus-google-fonts/trunk/readme.txt

    r3243818 r3254070  
    66Tested up to: 6.7
    77License: GPLv2 or later
    8 Stable tag: 3.9.1
     8Stable tag: 3.9.2
    99
    1010The easiest to customize fonts in WordPress. Optimized for Speed. 1000+ font choices. Supports Google Fonts, Adobe Fonts and Upload Fonts.
Note: See TracChangeset for help on using the changeset viewer.