• Resolved menathor

    (@menathor)


    Hi guys,

    Is it possible to make a Kirki customizer control update any database value? For example I have a plugin which adds some widgets to the frontend. The plugin has colour and typography settings for those widgets. I’d like to create a customizer section to control those settings.

    The idea would be to save the values I set in the customizer directly to the plugin’s wp_options values, and to refresh the customizer preview pane to display the changes as normal.

    Thanks!

    • This topic was modified 4 years, 6 months ago by menathor.
    • This topic was modified 4 years, 6 months ago by menathor.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @menathor,

    if you have Kirki set up to use options you could, in theory, override those existing settings using Kirki.

    A more convenient way would be to actually use the saved values in Kirki and then filter the output of the other plugin (if possible).

    Thread Starter menathor

    (@menathor)

    @davidvongries Thanks! I had a look into filtering the other plugin and unfortunately it’s not going to be possible. Would it be possible to use some kind of action hook that fires when each control is changed? That way I could do anything else I needed to before the page is refreshed.

    And if it’s not currently possible, could you add some hooks for this to v4?

    In theory, you could get the values saved by Kirki (no matter if saved as options or theme_mods) and override the values that are coming from the other plugin for instance on the customizer publish button click.

    I’m not sure if this should exist in Kirki core. Let’s see if we can get some other opinions on that here in this thread.

    Marking this as resolved for now as this is possible in theory but requires custom code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Linking customizer settings to any DB value’ is closed to new replies.