In order to simplify things, I have a social icon in my WP theme, that I want to enable users to modify via the WP customizer:
$wp_customize->add_setting(
'tcx_social_twitter',
array(
'default' => 'fa fa-twitter'
)
);
$wp_customize->add_control(
'tcx_social_twitter',
array(
'section' => 'tcx_social',
'label' => 'Social links',
'type' => 'text'
)
);
Then in my theme layout to show the icon to the end user. Everything works great so far.
Now I want to enable future adinistrators of my theme to add as many social icons, as they want. I believe this requires adding settings and controls dynamically, however I faild to find any information on this question in the official WP docs. Any help would be greatly appreciated!
Read more here: WordPress customizer: Add settings and controls dynamically