[wp-trac] [WordPress Trac] #30448: Customizer Manager/Settings classes do not provide public save method to use outside of customize.php
WordPress Trac
noreply at wordpress.org
Fri Jan 2 06:35:53 UTC 2015
#30448: Customizer Manager/Settings classes do not provide public save method to
use outside of customize.php
-------------------------+------------------------------
Reporter: CrazyJaco | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.0
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
-------------------------+------------------------------
Comment (by westonruter):
Replying to [comment:2 CrazyJaco]:
> I was able to do what I needed with just this added filter rather than a
whole new public function.
What are you trying to do, exactly? What does your
`filter_customize_save_value` function do?
Also, instead of adding a new filter to change the value being saved, I
think what you actually want is to allow the
`WP_Customize_Setting::save()` method to allow an argument to be supplied,
whereas right now it always gets its value from `$_POST`. So you could do
this:
{{{#!php
foreach ( $wp_customize->settings() as $setting ) {
$setting->save( $my_override_values[ $setting->id ] );
}
}}}
When a value is passed in to the `save` method, then it could bypass the
call to `$this->post_value()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30448#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list