The reality is that the return value for WP_Customize_Setting::update()
(a protected method) value is not even used in Core. As I can see, it is only used in WP_Customize_Setting::save()
and is called as:
$this->update( $value );
So its return value is not used. The WP_Customize_Setting::save()
method is called via WP_Customize_Manager::save()
:
foreach ( $this->settings as $setting ) {
$setting->save();
}
The @return
tag for the update()
method says that the return value is supposed to be “The result of saving the value.” Currently this only returns a value (other than null
/void) when it calls WP_Customize_Setting::_update_option()
, since it does return a value. But WP_Customize_Setting::_update_theme_mod()
does not return a value, and for custom types, calling do_action()
also does not return a value.
In the latter case, it can just be changed to return whether there was was any callback added for that action to begin with.
See 34140.diff.