[wp-trac] [WordPress Trac] #37974: Add multi-panel feature to pages through add_theme_support
WordPress Trac
noreply at wordpress.org
Fri Sep 9 18:31:02 UTC 2016
#37974: Add multi-panel feature to pages through add_theme_support
-----------------------------+------------------------------
Reporter: karmatosed | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-----------------------------+------------------------------
Comment (by karmatosed):
@celloexpressions wow thanks for catching comments couldn't be left :/
I haven't thought the development of this out so far. If I look at what
Pique has now:
{{{
// Panel 1
$wp_customize->add_section( 'pique_panel1', array(
'title' => esc_html__( 'Panel 1', 'pique' ),
'active_callback' => 'is_front_page',
'panel' => 'pique_options_panel',
'description' => __( 'Add a background image to your
panel by setting a featured image in the page editor. If you don’t
select a page, this panel will not be displayed.', 'pique' ),
) );
$wp_customize->add_setting( 'pique_panel1', array(
'default' => false,
'sanitize_callback' => 'pique_sanitize_numeric_value',
) );
$wp_customize->add_control( 'pique_panel1', array(
'label' => esc_html__( 'Panel Content', 'pique' ),
'section' => 'pique_panel1',
'type' => 'dropdown-pages',
) );
$wp_customize->add_setting( 'pique_panel1_background', array(
'default' => 'default',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage',
) );
$wp_customize->add_control( 'pique_panel1_background', array(
'label' => esc_html__( 'Background Color', 'pique' ),
'section' => 'pique_panel1',
'type' => 'color',
) );
$wp_customize->add_setting( 'pique_panel1_opacity', array(
'default' => 'default',
'sanitize_callback' => 'pique_sanitize_opacity',
'transport' => 'postMessage',
) );
$wp_customize->add_control( 'pique_panel1_opacity', array(
'label' => esc_html__( 'Featured Image Opacity',
'pique' ),
'section' => 'pique_panel1',
'type' => 'select',
'description' => esc_html( 'Set the opacity of the
featured image over the panel background.', 'pique' ),
'choices' => array(
'0.25' => esc_html__( '25%', 'pique' ),
'0.5' => esc_html__( '50%', 'pique' ),
'0.75' => esc_html__( '75%', 'pique' ),
'1' => esc_html__( '100%', 'pique' ),
),
) );
}}}
https://themes.svn.wordpress.org/pique/1.2.9/inc/customizer.php for
reference.
Now, I'm not thinking we should use this method, more pointing at
currently how it happens. This is something that is only for that theme.
If you switch the theme has no impact.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37974#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list