My settings are not saving in wordpress theme options page

▼魔方 西西 提交于 2019-12-04 17:04:43

I found an answer for this question earlier today. According to the tutorial, I needed to make sure the names for each option (input field, select box options, etc) were specified as name="coolorange_options[some_text]". I named the some_text part after the id, for example name="coolorange_options[image_url].

In the tutorial, in which I followed a newer version at http://ottopress.com/2009/wordpress-settings-api-tutorial/, each name gets recognized by php as an array. The names co_restore_selectbox[select_options] didn't show up as part of the array until I changed them to coolorange_options[select_options]. When I checked options.php again in my browser, the entry under coolorange_options showed the words SERIALIZED DATA, which I assume means the array was written to the options database.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!