[wp-hackers] Coding Standards: Functions vs. Classes

Brad Touesnard brad at touesnard.com
Sun Mar 18 18:27:42 UTC 2012


>
> 2. Are there several pieces of data that needs to be constantly passed
> around between those functions? Use a class.
>

But shouldn't register_post_type() and it's related functions be contained
in a class as they pass around the global $wp_post_types? Those functions
were written relatively recently.


I don't think new globals were introduced since we dropped PHP4, but I
> haven't see static class variables used yet either.
>

Should be interesting to see if globals are abandoned for static class
variables going forward.

I think most of this stuff would make a good wiki article so everyone is on
the same page. Should we start one?

-bt


More information about the wp-hackers mailing list