Saving all values in “multiple select”

前端 未结 2 1196
长发绾君心
长发绾君心 2021-01-29 01:33

im having a metabox in wordpress with a mutliple select form.


    
    

Notice the [] in the name: name="my_meta_box_select[]"

This, alongside the multiple attribute, will allow your $_POST variable to contain all selections as an array. That said, $_POST['my_meta_box_select'] will not just be a simple value, but rather will be an array will all selections.

提交回复
热议问题