#36605 closed defect (bug) (invalid)
Input types of URL and number do not render correctly in customizer
Reported by: | dpegasusm | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5 |
Component: | Customize | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
I have the following code adding an input type to the customizer:
<?php $wp_customize->add_control( 'my_counter_control', //Set a unique ID for the control array( 'label' => __( 'Number of items to show:', 'language' ), 'section' => 'my_section', 'settings' => 'my_setting', 'type' => 'number', 'input_attrs' => array( 'min' => 0, 'max' => 10 ) ) );
when rendered the html on inspection is:
<input type="text" value="">
and not the number with a min and max value
Changing a value in the field does not cause the save button to change to "Save and Publish" either and changing another field and saving the customizer does not affect the value of this field.
in the page source the correct item appears in the customize settings array:
s["my_setting"] = {"value":"6","transport":"refresh","dirty":false};
and later on:
c["my_setting"] = {"settings":{"default":"my_setting"},"type":"number","priority":10,"active":true,"section":"my_section","content":"<li id=\"customize-control-my_setting\" class=\"customize-control customize-control-number\">\n\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"customize-control-title\">Number of Items to show:<\/span>\n\t\t\t\t\t\t\t\t\t\t<input type=\"number\" min=\"0\" max=\"10\" value=\"6\" data-customize-setting-link=\"my_setting\" \/>\n\t\t\t\t<\/label>\n\t\t\t\t\t\t<\/li>","label":"Number of Items to show:","description":"","instanceNumber":39};
This is also happening to URL fields.
Attachments (2)
Change History (6)
Note: See
TracTickets for help on using
tickets.
I can't seem to reproduce this issue. See 36605-ok.png which is what I see with the following plugin added: