Opened 10 years ago
Closed 10 years ago
#31330 closed defect (bug) (fixed)
Customizer Controls with a `type` of `hidden` receive a margin
Reported by: | dlh | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Customize | Keywords: | has-patch |
Focuses: | ui | Cc: |
Description
WP_Customize_Control
s with a type
of hidden
receive a margin-bottom: 8px
, creating a slight gap when they are next to visible controls.
The attached patch removes the bottom margin on .customize-control-hidden
.
Example code and screenshots:
function demo_customize_hidden( $wp_customize ) {
$wp_customize->add_section( 'demo_section', array(
'title' => 'Example Section',
'priority' => 10,
) );
$wp_customize->add_setting( 'demo_first_text_setting' );
$wp_customize->add_setting( 'demo_second_text_setting' );
$wp_customize->add_setting( 'demo_hidden_setting' );
$wp_customize->add_setting( 'demo_third_text_setting' );
$wp_customize->add_control( 'demo_first_text_control', array(
'label' => 'Demo First Text Setting',
'section' => 'demo_section',
'settings' => 'demo_first_text_setting',
'type' => 'text',
) );
$wp_customize->add_control( 'demo_second_text_control', array(
'label' => 'Demo Second Text Setting',
'section' => 'demo_section',
'settings' => 'demo_second_text_setting',
'type' => 'text',
) );
$wp_customize->add_control( 'demo_hidden_control', array(
'section' => 'demo_section',
'settings' => 'demo_hidden_setting',
'type' => 'hidden',
) );
$wp_customize->add_control( 'demo_third_text_control', array(
'label' => 'Demo Third Text Setting',
'section' => 'demo_section',
'settings' => 'demo_third_text_setting',
'type' => 'text',
) );
}
add_action( 'customize_register', 'demo_customize_hidden' );
Before:
After:
Attachments (3)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Looks like screenshots require an Evernote account, but the patch makes sense.