Skip to content

Instantly share code, notes, and snippets.

@anteprimorac
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anteprimorac/3552dc410e6fdd8b0ee7 to your computer and use it in GitHub Desktop.
Save anteprimorac/3552dc410e6fdd8b0ee7 to your computer and use it in GitHub Desktop.
<?php
function slicejack_customize_register( $wp_customize ) {
/* ... */
/* ------- Layouts ------- */
$wp_customize->add_section( 'layouts', array(
'title' => __( 'Layouts', 'sj' ),
'priority' => 40
) );
$wp_customize->add_setting( 'sj_global_layout', array(
'default' => 'left',
'transport' => 'postMessage'
) );
$wp_customize->add_control( new sj_Layout_Control( $wp_customize, 'sj_global_layout', array(
'label' => __( 'Global', 'sj' ),
'section' => 'layouts',
'layouts' => array(
'none' => array(
'label' => __( 'None', 'sj' )
),
'left' => array(
'label' => __( 'Left', 'sj' )
),
'right' => array(
'label' => __( 'Right', 'sj' )
)
),
'priority' => 1
) ) );
/* ... */
}
add_action( 'customize_register', 'slicejack_customize_register' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment