Skip to content

Instantly share code, notes, and snippets.

@bradpotter
Last active August 29, 2015 14:04
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 bradpotter/5fbf68b2b06847a554e9 to your computer and use it in GitHub Desktop.
Save bradpotter/5fbf68b2b06847a554e9 to your computer and use it in GitHub Desktop.
<?php
/**
*
*/
class My_Genesis_Customizer extends Genesis_Customizer_Base {
/**
* Settings field.
*/
public $settings_field = 'genesis-settings';
/**
*
*/
public function register( $wp_customize ) {
$this->front_page( $wp_customize );
}
private function front_page( $wp_customize ) {
$wp_customize->add_section(
'front_page_manager',
array(
'title' => 'Front Page Manager',
'priority' => 10,
)
);
$wp_customize->add_setting(
$this->get_field_name( 'front_page_select' ),
array(
'default' => '',
'type' => 'option',
)
);
$wp_customize->add_control(
'genesis_front_page_select',
array(
'label' => 'Select Front Page',
'section' => 'front_page_manager',
'settings' => $this->get_field_name( 'front_page_select' ),
'type' => 'select',
'choices' => array(
'front-page.php' => __( 'front-page.php', 'genesis' ),
'front-page-five.php' => __( 'front-page-five.php', 'genesis' ),
),
)
);
}
}
add_action( 'init', 'my_genesis_customizer_init' );
/**
*
*/
function my_genesis_customizer_init() {
new My_Genesis_Customizer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment