I am using the WordPress Customizer and I'd like to add options for categories, for instance "category background image", and so in the Customizer you go on Category X in the preview, you then set the category background option to be "red", and you then navigate to Category Y in the preview, and using the same option you can set it to be "blue" for this particular category. And the idea is you could do this with unlimited categories, so they can all have different background colors.
Is this possible? I know you can use the active_callback
to make options in the customizer itself appear/disappear depending on where you are (i.e on a category page), but can you make options save an array with the current category ID seen in the preview + a value?
You could add all your options and use the active_callback
parameter on the parent sections. In your active_callback
function you could have something like return(is_category(Category ID, name, slug, or array of Category IDs, names, and/or slugs))
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With