[wp-trac] [WordPress Trac] #30951: Customizer: visible values (choices) not correct after setting it through javascript

WordPress Trac noreply at wordpress.org
Sat Jan 10 09:22:20 UTC 2015


#30951: Customizer: visible values (choices) not correct after setting it through
javascript
--------------------------+------------------------------
 Reporter:  katazina      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Customize     |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  javascript
--------------------------+------------------------------

Comment (by katazina):

 {{{
 $wp_customize->add_setting('image_align_center', array(
     'default'   => 0,
     'sanitize_callback' => 'absint'
 ));
 $wp_customize->add_control('image_align_center', array(
     'label'      => 'Position pictures to the center',
     'section'    => 'cbtc_theme_options',
     'settings'   => 'image_align_center',
     'type'       => 'checkbox'
 ));
 }}}


 I tried it with:
 {{{
 $wp_customize->add_setting('image_align_center', array(
     'default'   => '0',
     'sanitize_callback' => 'absint'
 ));
 }}}

 It's maybe, because I called the `sanitize_callback` function with
 `absint`?
 But I wrote that for radio buttons also, and there string were what
 accepted.

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


More information about the wp-trac mailing list