[wp-hackers] Meta boxes and post metadata
a.hoereth at gmail.com
Thu Feb 21 12:01:20 UTC 2013
Same here: Only create DB entries when they contain information.
Use "not existing" equal to "empty" => if empty, delete.
2013/2/21 Steve Taylor <steve at sltaylor.co.uk>
> A plugin I do (
> used to create DB records even if nothing was entered into the custom
> field. I changed it to not create a record if the value is empty, also
> to delete the existing record if it exists, but the new value entered
> is empty.
> No problems so far - I think in retrieving values you get the same
> result from an empty record as from no record.
> I'd be interested to hear if anyone else has alternate views on this.
> On 20 February 2013 16:05, Radi Varbanov <aparoph at gmail.com> wrote:
> > Hi Everyone,
> > First time posting here, so please bare with me :)
> > I am working on a site that is using the Yoast wpseo plugin and noticed
> > that even if you leave the SEO fields empty the plugin will store an
> > row into the wp_postmeta table. That made me think about how I should use
> > meta boxes.
> > So my question is:
> > When I use custom meta boxes should I also insert empty rows into the
> > wp_postmeta table or I should check to see if the fields is empty and if
> > is, do not store anything? With small websites that my be not a problem
> > when you have 50k+ posts and have ~10 custom post meta boxes and 11 form
> > the SEO plugin that adds up very fast.
> > Thanks,
> > Radi.
> > _______________________________________________
> > 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