-
Notifications
You must be signed in to change notification settings - Fork 330
Refactor Background control #1140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Maybe we can hide the dropdowns unless an image has been selected/uploaded? |
|
@Quaked good suggestion 👍 |
|
@lionhurt I just checked and there are no commits in your pull-request other than some old commits that I made 5-6 months ago. |
|
i explain everything in my comment and i leave this note
|
|
@lionhurt Hi I have one question, in the background-control.php you enqueue the mom-backgrodund.js on line 10. What is this file ? |
|
We now have a background control. |
Hi,
i follow this tutorial for awesome Justin Tadlock so many thanks to him : http://justintadlock.com/archives/2015/05/26/multiple-checkbox-customizer-control
Intro:
i work on new wordpress theme and i moved from redux framework to kirki. the problem is redux has a lot of useful fields i miss it in kirki like background, link color (color, :hover, :active), border and spacing field that support postMesage.
Technically to build all of this fields you need to build control with multiple inputs and save all of this inputs in a associative array so from this concept i start build the background control.
My prefix: mom_
Files:
background-control.php - gist
background-control.js - gist
background-control-preview.js - gist
Add field:
Get field value:
Results:

How it works:
i create inputs with simple HTML code. collect the information of each input with name attribute to build a valid json string to save it in value-holder input (hidden input).
then sanitize the json string with this function to build the associative array to save in wordpress database as theme mod.
What i miss:
Conclusion:
This is my first pull request and i don't know what i do so i explain everything in this comment, i hope that be helped