[wp-hackers] How to use $wpdb in plugins

Leo Baiano ljunior2005 at gmail.com
Tue Jan 7 00:32:46 UTC 2014


I liked the idea, I'll do a test here.


2014/1/6 Ben May <bmay at alyte.com.au>

> I usually have a base class that all other classes extend, and have a
> self::db() which basically globals $wpdb once and returns it, saves having
> to write global $wpdb; each class.
>
>
> On 7 January 2014 01:58, Leo Baiano <ljunior2005 at gmail.com> wrote:
>
> > What better way to use the global $ wpdb in building a plugin? I'm
> working
> > on a plugin and some methods need to access data in the database tables,
> > including creating, and I was in doubt about the best way, like, do not
> > want to quit repeating global $ wpdb in all methods of my class.
> >
> > How do you do?
> >
> > --
> > Amplexos,
> >
> > Leo Baiano
> > Web Developer
> > _______________________________________________
> > 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
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Amplexos,

Leo Baiano
Web Developer


More information about the wp-hackers mailing list