Opened 11 years ago
Closed 11 years ago
#27979 closed enhancement (fixed)
Pass Customizer Setting instance to `customize_update_` and `customize_preview_`
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
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
@
11 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!
This ticket was mentioned in IRC in #wordpress-dev by salcode. View the logs.
11 years ago
This ticket was mentioned in IRC in #wordpress-dev by SergeyBiryukov. View the logs.
11 years ago
#9
@
11 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 28767:
Note: See
TracTickets for help on using
tickets.
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.