Last active
August 29, 2015 14:04
-
-
Save bradpotter/5fbf68b2b06847a554e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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