[wp-trac] [WordPress Trac] #31330: Customizer Controls with a `type` of `hidden` receive a margin
WordPress Trac
noreply at wordpress.org
Sat Feb 14 08:32:18 UTC 2015
#31330: Customizer Controls with a `type` of `hidden` receive a margin
--------------------------+-----------------------------
Reporter: dlh | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: trunk
Severity: normal | Keywords:
Focuses: ui |
--------------------------+-----------------------------
`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:
{{{#!php
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:
[[Image(https://www.evernote.com/shard/s155/sh/2106ceba-8197-44df-8367-cc1aee8da17e/2682f9db55532564c9ae86c251117930/res/f4a035f0
-9cee-4ed6-8cd5-6c79a0faaa1e/customize-before.jpg)]]
After:
[[Image(https://www.evernote.com/shard/s155/sh/2106ceba-8197-44df-8367-cc1aee8da17e/2682f9db55532564c9ae86c251117930/res/0a0cf714-9446
-4c3e-be5d-ca0aa3c2c4b1/customize-after.jpg)]]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31330>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list