[wp-hackers] Custom Post Type
nitephire at gmail.com
Sun Jan 27 22:45:15 GMT 2008
Well, that fixes one problem but creates another. I created a simple test
plug-in to run the following code in a function applied by the posts_where
if ( !is_admin() ) $where = eregi_replace ("post_type = 'page'", "(
post_type = 'page' OR post_type = 'group' )", $where);
This does make it so that WP will display. However, I think basically it
eliminates distinctions. Under both 'Manage Pages' and 'Manage Posts' all
records of the posts table are returned. Any idea why that would happen?
On 1/27/08, Austin Matzko <if.website at gmail.com> wrote:
> On Jan 27, 2008 4:51 PM, Dan Larkin <nitephire at gmail.com> wrote:
> > I do not want these special pages to show up under Manage Pages or
> Posts. I do want them to show up when one navigates to the pages'
> > Again, correct me if I'm wrong, but it
> > seems like using set_query_var() will return only those posts which are
> > the special value when used in a separate query. This isn't what I want
> > do at all. I want the main query that handles usual post and page
> > to simply get a little extra code functionality to display posts with
> > 'post_type' values.
> So you want posts of both post_type "post" and post_type "group" to be
> included together? Then I would use the 'posts_where' filter to call
> back a function where a regular expression replaces post_type = 'post'
> with (post_type = 'post' OR post_type = 'group').
> To keep the admin area from being affected, just test with
> "is_admin()" before applying the filter.
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers