Opened 12 years ago
Closed 12 years ago
#27979 closed enhancement (fixed)
Pass Customizer Setting instance to `customize_update_` and `customize_preview_`
| Reported by: | danielbachhuber | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.0 |
| Component: | Customize | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch commit |
| Cc: | Focuses: |
Description
The customize_update_ and customize_preview_ actions would benefit from having the setting instance passed to them. When using a custom type, it would be helpful to have a reference as to which setting is being saved in case a common callback is being used to save / preview all settings of a given custom type.
Attachments (4)
Change History (15)
#3
@
12 years ago
Hi tormorten,
Thanks for looking into this. A few notes:
- Rather than upload the whole file, can you create a patch from the WordPress root? We use patches so that it's easier to review and commit changes.
- Be sure to update the inline documentation to include the new parameter (something like
@param WP_Customize_Setting $this WP_Customize_Setting instance.). - When you upload patches in the future, be sure to leave a comment and add the "has-patch" keyword to the ticket. Attaching files doesn't send notifications, only comments do, and adding has-patch will help with the review process.
If you have any questions, feel free to ask for clarification!
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Huge +1. I'm running into this with my Menu Customizer GSoC project, and the setting instance provides good context when performing the types of operations that occur frequently with custom setting types.
I'll upload a patch if no one grabs the good-first-bug in the next couple days. It's a good first bug in its simple fix and being self-contained, although this is a fairly advanced concept in terms of finding and understanding it.