bueltge
1/15/2013 - 2:17 PM

Example to use the taxonomie Dropdown for Customizer, the classes are inside the project: https://github.com/bueltge/Wordpress-Theme-Customi

Example to use the taxonomie Dropdown for Customizer, the classes are inside the project: https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls

<?php
/**
 * @see: https://github.com/bueltge/Wordpress-Theme-Customizer-Custom-Controls
 */
add_action( 'customize_register', 'fb_customize_register' );
function fb_customize_register( $wp_customize ) {

	require_once( 'class-taxonomy_dropdown_custom_control.php' );
	 
	$wp_customize->add_section(
		'my_theme_blog_featured_categories', array(
			'title' => __( 'Featured Categories', 'textdomain' ),
			'priority' => 36,
			'args' => array(), // arguments for wp_dropdown_categories function..., optional
		)
	);
	
	$wp_customize->add_setting(
		'featured_category_1', array(
			'default' => get_option( 'default_category', '' ),
		)
	);
	
	$wp_customize->add_control(
		new Taxonomy_Dropdown_Custom_Control(
			$wp_customize, 'featured_category_1', array(
				'label' => __( 'Featured Area 1', 'textdomain' ),
				'section' => 'my_theme_blog_featured_categories',
				'settings' => 'featured_category_1',
			)
		)
	);
	
	return $wp_customize;
}