Populate Dropdwon with DIR files, save value and keep it “selected”
You need to add a ‘selected’ value to the option output, so that the html displays the value that’s saved in the psg_settings. Something like this: function psg_dyn_select_1_render ( ) { $options = get_option( ‘psg_settings’ ); $files = glob( plugin_dir_path( __FILE__ ) . “assets/images/*” ); ?> <select name=”psg_settings[psg_dyn_select_1]”> <?php foreach ($files as $filename){ $filename = … Read more