[Resolved] Import of customizer settings not very helpful

Home Forums Support [Resolved] Import of customizer settings not very helpful

Home Forums Support Import of customizer settings not very helpful

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2223362
    mkjj

    Today, I was frustrated with GP for the very first time. I prefer the child stylesheet for colors and typography. Usually, I remove all settings in the customizer (to avoid unnecessary styles in the source code). I thought, I could export the global color settings from a site and import them into another. Well, sort of. But the import file contains only very few settings and by far not ALL colors. In my humble opinion, this is not very helpful. I tried then a full export, which (of course) made a mess of my site, since it overrides all settings. Is there no workaround for removing all color settings without doing it one by one manually? The only option I can see is to remove all color settings in a new and untouched installation and download ALL settings. This would remove the color settings in a new site while not affecting anything else.

    Thank you, Mike

    #2223640
    David
    Staff
    Customer Support

    Hi there,

    sorry to hear about your frustration.
    So ideally you would like a simple way to remove any of the Customizer color settings ?

    Let us know and ill check with the team

    #2224732
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    We can remove all color defaults from a fresh install like this:

    add_filter( 'generate_option_defaults', function( $defaults ) {
        $defaults['background_color'] = '';
        $defaults['text_color'] = '';
        $defaults['link_color'] = '';
        $defaults['link_color_hover'] = '';
    
        return $defaults;
    }, 100 );
    
    add_filter( 'generate_color_option_defaults', function( $defaults ) {
        $new_defaults = [];
    
        foreach ( $defaults as $key => $value ) {
            $new_defaults[ $key ] = '';
        }
    
        return $new_defaults;
    }, 100 );

    This will remove all GP colors (unless they’re saved in the Customizer).

    Let me know if this helps or not ๐Ÿ™‚

    #2224967
    mkjj

    Sorry, I didn’t want to sound rude. I love GP, and I love how GP uses the customizer. ๐Ÿ™‚

    So ideally you would like a simple way to remove any of the Customizer color settings?

    That would be great. But as good or even better would be an export option for ALL colors (not only the global colors). This would allow for very good fine-tuning. On the other hand, the export of all settings is quite good, if you use a clean installation with everything reset to default. I could then create a bunch of exports with different profiles.

    So, there is not REALLY any need for improvement, as long as you have a test environment for creating the export files. If you work for customers, this is not a big deal, since you usually have at least one test installation.

    So, my mistake. I just hadn’t really thought it through.

    #2224985
    mkjj

    Let me know if this helps or not.

    Hi Tom,

    that did exactly what I was looking for. Great snippet. Thank you very much for providing it!

    Thanks, Mike

    #2226128
    Stacey Usborne
    Staff
    Customer Support

    Awesome, I’m glad I could help!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.