[wp-hackers] Re: $single

Ryan Boren ryan at boren.nu
Sun Jun 20 19:13:15 UTC 2004


On Wed, 2004-06-16 at 12:30, David Chait wrote:
> Yeah, I agree on both points.
> 
> For page_type, I'm not sure what's needed more than home, single, archive -- 
> in terms of raw usage.  Maybe a secondary variable to get more specific, but
> then again for people like me, if it isn't home or single, it's archive...
> ;)

Here's what I have:

is_single()
is_date()
is_category()
is_author()
is_archive() = date || category || author 
is_search()
is_feed()

These return true or false.

> I'd love to see a single global $wp or such.  I'd also like to see the
> current approach of 'shoehorning' current table state into $wpdb undone,
> where it really wants to be in a $wp or $page object.  Keep $wpdb clean.

Yeah, I'd like some better namespacing. is_single() and friends get the
states from a $wp_state "object".  I don't expose $wp_state in the
templates cause I don't think template writers should have to put up
with OO syntax or namespaces.  Wrap all that in simple function calls
like all the template tags.

Ryan

> > Message: 4
> > Date: Tue, 15 Jun 2004 23:22:36 -0600
> > From: Alex King <alex at alexking.org>
> > Subject: Re: [wp-hackers] $single
> > To: hackers at wordpress.org
> > Message-ID: <2D61E803-BF55-11D8-AEC3-000D9368D632 at alexking.org>
> > Content-Type: text/plain; charset=US-ASCII; format=flowed
> >
> > I'd rather have one 'page_type' variable than a bunch of binary
> > variables.
> >
> > On a related note (and as I've mentioned previously on the other list),
> > I'd like to see us develop a $wp or $page object that stores the WP
> > context. There are a number of benefits to this approach, some of the
> > big ones
> 
> 
> 
> _______________________________________________
> hackers mailing list
> hackers at wordpress.org
> http://wordpress.org/mailman/listinfo/hackers_wordpress.org




More information about the hackers mailing list