[wp-trac] [WordPress Trac] #34140: WP_Customize_Setting::update( $value ) bad return value

WordPress Trac noreply at wordpress.org
Sat Oct 3 23:07:55 UTC 2015


#34140: WP_Customize_Setting::update( $value ) bad return value
--------------------------+------------------------------
 Reporter:  wpweaver      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.3.1
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by westonruter):

 @wpweaver I don't understand what you're trying to do here with this
 action.

 To supply a value for a custom type, you can use  the filter
 `'customize_value_' . $this->id_data['base']` (which as reported
 elsewhere, is insufficient, see #29316).

 To preview a modified value for a custom type, use the
 `customize_preview_{$this->id}` or `customize_preview_{$this->type}`
 actions.

 To save a value for a custom type, use the action
 `customize_update_{$this->type}`.

 Or, which can be much easier to manager, just subclass
 `WP_Customize_Setting` and then override the `value`, `preview`, and
 `update` methods respectively.

 To use a custom setting subclass, instead of doing:

 {{{
 $wp_customize->add_setting( $id, $args );
 }}}

 You instead do:

 {{{
 $wp_customize->add_setting( new My_Custom_Setting( $wp_customize, $id,
 $args ) );
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34140#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list