Customizing the customizer
Example adding new items to the WordpPess customize section:
$wp_customize->add_section( 'just_listed' , array(
'title' => __( 'Just Listed Settings', 'microformata' ),
'priority' => 53,
));
$lab = array("City, State", "Bed", "Bath", "From price", "To price");
$just = array();
for($ii=0; $ii<5; $ii++){ $just[] = array( 'slug'=>'just' . $ii,
'default' => '',
'label' => $lab[$ii%5],
);
}
foreach( $just as $e ) {
// SETTINGS
$wp_customize->add_setting(
$e['slug'], array(
'default' => $e['default'],
'type' => 'option',
'capability' => 'edit_theme_options',
'transport' => 'refresh',
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'just_listed_text' . $e['slug'],
array(
'label' => $e['label'],
'section' => 'just_listed',
'settings' => $e['slug'],
'type' => 'text',
)
)
);
}//foreach
…
tags: & category: -