Opened 11 years ago
Closed 11 years ago
#27981 closed enhancement (fixed)
Support descriptions for Customizer Controls
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Customize | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Similar to how the Settings API has the "description" class and Customizer's Section class already supports descriptions, it would be nice if Customizer Controls also supported descriptions. The UI could be super minimal — a tooltip or similar would suffice.
Attachments (4)
Change History (18)
#2
@
11 years ago
Another +1 here. I'm extending classes on multiple control types specifically for adding descriptions. This would be lovely in core.
@
11 years ago
Implement descriptions for most core customizer controls, only output the control title & description markup if there's a title/description.
@
11 years ago
27981.diff with several sample controls. The section description is no longer italicized to provide visual hierarchy between the section description and the control descriptions.
#3
@
11 years ago
- Keywords has-patch added; needs-patch removed
I do like that not having the description option by default forces less UI clutter (at the expense of longer section descriptions), but it's definitely time to have a solution for this in core.
The implementation with 27981.diff is pretty straightforward:
$wp_customize->add_control( $setting_id, array( 'label' => $label, 'description' => $description, 'section' => $section_id, 'type' => $type, ) );
I added support for descriptions in all core types/controls except for the following:
dropdown-pages
WP_Customize_Header_Image_Control
WP_Widget_Area_Customize_Control
WP_Widget_Form_Customize_Control
This ticket was mentioned in IRC in #wordpress-dev by celloexpressions. View the logs.
11 years ago
#6
@
11 years ago
27981.2.diff fixes inconsistent margins on the radio input type between the label and the description.
This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.
11 years ago
#8
@
11 years ago
- Owner set to helen
- Resolution set to fixed
- Status changed from new to closed
In 28927:
#9
follow-ups:
↓ 10
↓ 11
@
11 years ago
Super excited for this commit!
I have one suggestion: I think esc_html
is unnecessarily restrictive and should be removed. Since these descriptions should never be populated via user input (and if they are, that's on the dev to work out), the description should be pre-escaped. I find this to be particularly limiting in that you cannot even add links or bold text.
#10
in reply to:
↑ 9
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Replying to tollmanz:
I have one suggestion: I think
esc_html
is unnecessarily restrictive and should be removed. Since these descriptions should never be populated via user input (and if they are, that's on the dev to work out), the description should be pre-escaped. I find this to be particularly limiting in that you cannot even add links or bold text.
Agreed. A section's description lacks esc_html
and so a control's description should omit it as well.
#11
in reply to:
↑ 9
@
11 years ago
Replying to tollmanz:
Super excited for this commit!
I have one suggestion: I think
esc_html
is unnecessarily restrictive and should be removed. Since these descriptions should never be populated via user input (and if they are, that's on the dev to work out), the description should be pre-escaped. I find this to be particularly limiting in that you cannot even add links or bold text.
Great catch here.
#13
@
11 years ago
+1 for 27981.3.diff.
Huge +1 to this. I've found myself needing to write custom controls just so that I'm able to add in extra instructions underneath inputs.