I am trying to make a slider configurable via the customizer. In order to let the user decide how many sliders he wants, I added a setting where the user can enter a number.
Based on this number I want to generate sections, settings, and controls in the customizer, under my slider panel.
The function that is building the sections looks like this:
function createSliders($array) {
foreach($array as $id) {
$wp_customize->add_section(
'slider_'.$id,
array(
'title' => __( 'Slider '.$slider, 'Kraftzwerg' ),
'capability' => 'edit_theme_options',
'panel' => 'slider'
)
);
$i++;
}
$array
only holds the identifier (0-max) for the slider.
If I start the customizer I get an instant 500 error.
I know that I can't see the sections because there are no settings and controls for the section. But I didn't get over the 500 error.
Can someone tell me why it won't run?