Editable select options in quick edit OR in plugin settings

Question

My plugin includes a select field that appears in the Quick Edit, but right now the values are hard coded in the plugin. I’d like to make these select options editable (add or remove option from select) and I’m not really picky about whether it’s editable in the Quick Edit or if I have to do it in the plugins Setting page.

This is how I have the select in my plugin to display on the Quick Edit page:

<select>
    <option value="Option1" <?php selected( $selected, 'Option1', false ); if ( $myoption == 'Option1' ) echo 'selected="selected"'; ?>>Option1</option>
    <option value="Option2" <?php selected( $selected, 'Option2', false ); if ( $myoption == 'Option2' ) echo 'selected="selected"'; ?>>Option2</option>
</select>

I’ve searched for days and found nothing specific to allowing edits to the options in a select field. I’m sure the solution is storing the list of options in the database then retrieving them, but that’s where I’m lost.

Any guidance appreciated.

0
KSechrist 2 months 2022-06-25T15:17:15-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse