[wp-hackers] Plugin options being cleared on save

Chris Jean gaarai at gaarai.com
Mon Oct 18 20:24:52 UTC 2010


I should have clarified that my example wasn't meant to be best practice 
for everything. Just a very terse example of what I meant by checking 
for the existence or absence of a checkbox variable given context with 
some additional code.

Chris Jean (AKA gaarai&  chrisbliss18)
Coder for http://ithemes.com/
http://gaarai.com/
@chrisjean


On 10/18/2010 02:27 PM, Scott Bressler wrote:
> Hmm, well, this would be in the sanitization callback, right? So it'd be
> array_merge with the passed parameter. Otherwise, makes sense. I've actually
> always just written my code with array_key_exists for checkboxes, but it
> definitely does make more sense to just set to 0 if missing.


More information about the wp-hackers mailing list