Opened 12 years ago
Last modified 8 years ago
#29316 new enhancement
Need more value and preview hooks for WP_Customize_Settings
| Reported by: | dedepress | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | Future Release |
| Component: | Customize | Version: | 3.4 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
Description
There should have more filters to handle settings.
for example:
add
apply_filters( 'customize_value', $this->defaults, $this);
or
apply_filters( 'customize_value_'.$this->type, $this->default, $this);
before
apply_filters( 'customize_value_' . $this->id_data[ 'base' ], $this->default );
add
do_action( 'customize_preview_setting', $this );
before
do_action( 'customize_preview_' . $this->id, $this );
Attachments (1)
Change History (19)
#3
@
12 years ago
- Focuses administration removed
- Version 3.9.2 → 3.4
I don't think we would want to add non-type-specific filters, like customize_value, but customize_value_$this->type might be useful (do you have a specific use-case or example for that?). I'm not sure that it would make sense to apply any filters to all settings regardless of their type, as they are handled very differently depending on their types. But adding filters by type where there are currently only filters by id may be useful depending on the situation (and I think we would need to come up with some use-cases before implementing them).
#4
@
12 years ago
There is filter by type in WP_Customize_Setting->update(), but filter by id_base in WP_Customize_Setting->value(). so, it's hard to modify something via same type of filters for updating and retrieving.
I think
customize_value_$this->type, $this
is better than
customize_value_' . $this->id_data[ 'base' ], $this->default
assumed all of our setting ids is serialized, how to change value of each setting via the id_base filter? pre_option_* and pre_update_option* can achieved my goal, but filter by type will make things easier.
#5
@
12 years ago
- Keywords needs-patch added
- Milestone Awaiting Review → Future Release
The current customize_value_{$id_base} is extremely limited in use. We need the type-based filter as well, and these filters need to be passed the WP_Customize_Setting instance.
#6
@
12 years ago
- Milestone Future Release → 4.2
We need this for Settings with custom types to be able to properly get values when they aren't previewed (since as of [30102], only dirty settings get sent to preview, leaving unchanged settings to rely on the value-filters). Assigning to 4.2 milestone.
#7
@
11 years ago
Needs a patch asap if we're going to make the enhancements deadline Tuesday. This is one of our more punt-able tickets.
#8
@
11 years ago
- Type enhancement → feature request
We can punt. It is not technically required since you can just add ID-specific filters.
#11
@
10 years ago
- Summary Need more filters for WP_Customize_Settings → Need more value and preview hooks for WP_Customize_Settings
This ticket was mentioned in Slack in #core-customize by celloexpressions. View the logs.
10 years ago
This ticket was mentioned in Slack in #core-customize by westonruter. View the logs.
9 years ago
#17
@
9 years ago
- Priority normal → low
Marking as low priority since all can be accomplished by subclassing WP_Customize_Setting, which is cleaner anyway and more encapsulated.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #29165