Site logo

Archived topic

Import of customizer settings not very helpful

5 replies · Started by mkjj on May 18, 2022

Viewing posts 1–6 of 6

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

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

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 :)

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.

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

Awesome, I'm glad I could help!

This archived topic is closed to new replies.