“Apply” button appears in the widget customizer
I am developing on a new post plugin, we try to integrate with you API and trying hard to match all your structures.
In this new plugin, I have 3 different “TITLE & EXCERPT POSITION” for the “Display”.
In the widget When I change to a new TITLE & EXCERPT POSITION, there is a “Apply” button appearing in the head, like this:
I will need to apply it, before I can see preview in the customizer.
I like to know what the apply works for,
What I am guessing is this about applying new templates, so we can do a new template for each “TITLE & EXCERPT POSITION” isn’t it?
And I like to know what more the apply button are working for?
Possible Answers to Your Question:
@dreamwork, the Apply button will appear when the sanitized fields do not aligned with existing fields. This will disabled live updates and therefore display the Apply button. The solution is to be sure the fields that are submited inside of the widget’s form matches the existing fields.
I had the same problem and how I resolved it. I hope that helps!
Check out /wp-admin/js/customize-widgets.js Line 1119.
There should be no Apply button.
I recommend going back over the Widget section of the extension guide to ensure you are constructing the widget and using our form and toolbar controls correctly. View our stock content widget for comparison of structure.