[wp-hackers] Best practices for plugin with complicated settings?
Ashish Saini
ashishsainiashfame at gmail.com
Sun Jul 25 10:39:47 UTC 2010
Go it! Thanks :)
Also I would like to know if there is any size limitation of how much data
can be saved in a single row in the options table?
Instead of saving multiple rows, isn't it better to store it as a single
value in a row.
Regarding performance, consider that it can be something which is used in
the front-side or needed only in back-end (irrespective of site's
functioning, just an specific need to operate some data independently
integrated with WP install).
Would like to hear on your thoughts on this.
Thanks & Regards
Ashish Saini aka Ashfame
(Deserve Before You Desire)
Homepage : http://www.ashfame.com | Blog : http://blog.ashfame.com | Twitter
: http://twitter.com/ashfame
On Sun, Jul 25, 2010 at 2:36 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
> On Sun, Jul 25, 2010 at 4:57 AM, Ashish Saini
> <ashishsainiashfame at gmail.com>wrote:
>
> > What if I have multiple option pages for my single setting? Do I need to
> do
> > anything extra to take care of that?
> >
>
> The way I'd do it is as follows:
> - Register the setting multiple times, for each option group (page).
> - In the sanitization callback(s), make sure you account for other indices
> that may be stored but not accounted for on that page save. You can call
> get_option() for example and make sure you keep the original indices you
> want, and then replace the ones you're updating for that page.
>
> Regardless, heavy whitelisting and sanitization is critical to ensure
> stability and security.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list