Support » Plugin: Easy Google Fonts » New version is not backwards compatible?

  • Resolved ProgressionStudios

    (@progressionstudios)


    Thanks for pushing out a big update and supporting PHP8. That being said it looks like the old custom controls/API no longer works.

    Do you plan on supporting the old API $tabs and $controls?

    Or is there an easy way to make older custom controls/panels work with the new version?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Sunny Johal

    (@sunny_johal)

    Hi @progressionstudios
    Just to understand your issue, have you integrated with the older php filters in order to register custom font controls and panels? If so is it possible to show me the code and I’ll see what I can do. Thanks

    Thread Starter ProgressionStudios

    (@progressionstudios)

    Sure, here is a simplified example of removing the default heading/body tags.

    Then adding a new section “Default Text & H1-H6 Headings” within the panel with an id of “progression_studios_typography_panel”.

    PHP File: https://www.dropbox.com/s/iabqn25deut24ze/typography-controls.php.zip?dl=0

    Ps. Thanks for the quick response!

    Plugin Author Sunny Johal

    (@sunny_johal)

    Hi @progressionstudios
    So the easiest way to migrate old controls is to put the following code in your theme:

    
    add_filter(
    	'egf_get_settings_config',
    	function( $config ) {
    		return apply_filters( 'tt_font_get_option_parameters', $config );
    	},
    	10,
    	1
    );
    
    add_filter(
    	'egf_customizer_get_sections',
    	function( $sections ) {
    		return apply_filters( 'tt_font_get_settings_page_tabs', $sections );
    	},
    	10, 
    	1
    );
    
    add_filter(
    	'egf_customizer_get_panels',
    	function( $panels ) {
    		return apply_filters( 'tt_font_get_panels', $panels );
    	},
    	10,
    	1
    );

    `

    I wasn’t planning on adding backwards compatibility for this, but I can add this code to the plugin on a future release if enough people request it. Let me know if that works (wrote the code quickly, didn’t have time to test it). Thanks

    • This reply was modified 1 year, 4 months ago by Sunny Johal.
    Thread Starter ProgressionStudios

    (@progressionstudios)

    Unfortunately that code did not work. I received some errors like the one below:
    Notice: Undefined index: default in easy-google-fonts/src/includes/settings.php on line 334

    I’ve updated the file with the code added and both the panel & section. That way you can copy all of the code to a functions.php file for a quick test. This adds a new panel of “Typography New” with a color example. Just trying to get add panels/font controls that worked in the previous version. Seems like it’s pretty close.

    Updated Example: https://www.dropbox.com/s/j08vxfsxzvhd6iq/typography-controls-updated.zip?dl=0

    Plugin Author Sunny Johal

    (@sunny_johal)

    Hi @progressionstudios
    I’ve just pushed up a new version, could you upgrade and let me know if that solves your issue. Thanks

    Thread Starter ProgressionStudios

    (@progressionstudios)

    I updated but unfortunately it did not fix the issue. No custom controls or panels are loading that worked with the previous version.

    I have many websites I’ve designed for my clients, and almost all of them look brutal now, because all the font style designations I set up using Easy Google Fonts have disappeared and all the text content has reverted to plain text! This is not good.

    Plugin Author Sunny Johal

    (@sunny_johal)

    Hi @progressionstudios
    To confirm, you have downloaded version 2.0.2? I think I misunderstood what you were trying to achieve. Could you tell me what you are expecting to see in the customizer. In particular:

    • What panels are you expecting to see?
    • What controls are in each panel?

    @cyberbrad can you start a new thread with an example link where it isn’t working and confirm that you have v2.0.2 on those sites. I’ll give you a hand there.

    Thanks

    Thread Starter ProgressionStudios

    (@progressionstudios)

    Yes, I tested this with version 2.0.2 and it does not work. I can confirm it does work in version 1.4.4

    Panel) I added a panel called “Typography New” and this shows up (Standard filter
    ‘customize_register’)

    Section) I expect a section called “Default Text & H1-H6 Headings” to show up

    Controls) In this section I expect these controls:
    – Body Font
    – Heading 1
    – Heading 2
    – Heading 3 etc.
    Screenshot of previous version: https://progressionstudios.com/wp-content/uploads/2021/07/Version1.4.4.png

    Example:
    https://www.dropbox.com/s/j08vxfsxzvhd6iq/typography-controls-updated.zip?dl=0
    (This is a simplified example but covers the two $tabs and $controls functionality)

    Plugin Author Sunny Johal

    (@sunny_johal)

    Hi @progressionstudios
    Can you upgrade to 2.0.3 and confirm that it is working as it should. I have tested your latest code against this new release. Thanks

    Thread Starter ProgressionStudios

    (@progressionstudios)

    Wow, thanks for working on this so quickly. I can confirm the section and controls are showing up properly.

    Minor Fixe if possible:

    1) The section id used to add a prefix of ‘tt_font_’ to the naming convention. Can you add that in so that the old id’s match?

    Example: $tabs[‘progression-studios-default-headings’]
    The prior version would add a prefix to the tab id like so automatically: tt_font_progression-studios-default-headings

    Let me know if you can add that minor tweak. Other than that I’ve done a ton of tests and it’s working as expected.

    Leaving a 5 star review right now.

    Plugin Author Sunny Johal

    (@sunny_johal)

    Great thanks for letting me know. Regarding the prefix: is there a specific reason why you need it, is something not working as a result of it being omitted?

    Also thanks for leaving a review, much appreciated!

    Thread Starter ProgressionStudios

    (@progressionstudios)

    Nope, everything is working without the prefix. You can omit the prefix as I can just remove it with a simple find/replace.

    Thanks again for being so prompt and helpful.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘New version is not backwards compatible?’ is closed to new replies.