- This topic has 5 replies, 4 voices, and was last updated 1 year, 11 months ago by Stacey Usborne.
-
AuthorPosts
-
May 18, 2022 at 2:01 am #2223362mkjj
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
May 18, 2022 at 7:32 am #2223640DavidStaffCustomer SupportHi 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
May 18, 2022 at 7:17 pm #2224732TomLead DeveloperLead DeveloperHi 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 ๐
May 19, 2022 at 12:14 am #2224967mkjjSorry, 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.
May 19, 2022 at 12:34 am #2224985mkjjLet 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
May 19, 2022 at 8:05 pm #2226128Stacey UsborneStaffCustomer SupportAwesome, I’m glad I could help!
-
AuthorPosts
- You must be logged in to reply to this topic.