Closed solarmanawm closed 8 years ago
@solarmanawm can you please also post the configuration you're using for config_name
?
Kirki::add_config( 'config_name', array(
'capability' => 'edit_theme_options',
'option_type' => 'option',
) );
Instead of writing your settings like this:
'settings' => 'theme_options[h4-text-transform]',
You could write them like this:
'settings' => 'h4-text-transform',
and then have your config look like this:
Kirki::add_config( 'config_name', array(
'capability' => 'edit_theme_options',
'option_type' => 'option',
'option_name' => 'theme_options',
) );
This way, all the fields you create using the config_name
id will be saved like theme_options[$field_id]
Let me know if that helps!
Well... No changes. Still have that error.
I have a solution. I can use several field types instead of one complex. It is a bit more code but it works.
@solarmanawm yeah, the background field is a bit buggy and in fact I've wanted to deprecate it for quite some time now. I've removed it from the documentation so hopefully fewer people will be using it in the future. We have plans to add a new background field that will be saving its values as an array in the future instead of creating other settings like it does now. But that's a discussion for another time... :+1:
Hello, thanks for a great work on this toolkit. During my theme development I've met a strange thing. I'm adding fields using Kirki API like this:
And it is ok in general. Except with the 'background' field type. I mean this code:
will cause an error:
It seems the error occurs when I'm trying to use the 'settings' property as an array with any 'background' field type. When i'm doing this:
all is fine. What can be the problem? Thanks.