[wp-hackers] Plugin options being cleared on save
sbressler at gmail.com
Mon Oct 18 17:13:50 UTC 2010
Thanks for the reply, John. Nope, I'm not - I was hoping that wasn't
necessary. Nacin also mentioned this - could either include as a hidden
field or re-add in the sanitization callback.
On Mon, Oct 18, 2010 at 10:10 AM, John Blackbourn
<johnbillion+wp at gmail.com<johnbillion%2Bwp at gmail.com>
> Are you including the version number as a hidden field on the settings
> screen so it gets saved with the other options? The entire contents of
> the options field gets overwritten using the data that's submitted
> (ie. it doesn't just update the array keys that are submitted).
> On Mon, Oct 18, 2010 at 5:46 PM, Scott Bressler <sbressler at gmail.com>
> > I'm saving a plugin's options into a serialized array. On plugin
> > I insert a version number into the array, which properly appears when I
> > check the database. However, when I save the options that I added to the
> > "Writing" screen (using add_settings_section, add_settings_field, and
> > register_setting), which let the user change the other two settings in
> > serialized array, the version number is removed from the array.
> > Any idea why the version number is kicked out of the array on first save?
> > Thanks!
> > -Scott
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers