[wp-hackers] wp-hackers Digest, Vol 63, Issue 33

jtarleton at jamestarleton.com jtarleton at jamestarleton.com
Fri Apr 16 13:37:31 UTC 2010


ERFVbNNnr\\HaAQQAaAQQqqqqQQ
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: wp-hackers-request at lists.automattic.com
Date: Fri, 16 Apr 2010 07:16:45 
To: <wp-hackers at lists.automattic.com>
Subject: wp-hackers Digest, Vol 63, Issue 33

Send wp-hackers mailing list submissions to
	wp-hackers at lists.automattic.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://lists.automattic.com/mailman/listinfo/wp-hackers
or, via email, send a message with subject or body 'help' to
	wp-hackers-request at lists.automattic.com

You can reach the person managing the list at
	wp-hackers-owner at lists.automattic.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of wp-hackers digest..."


Today's Topics:

   1. Re: Using Meta Keys with pre_get_posts ?
      (Almost George WP-Hackers List)
   2. Re: Using Meta Keys with pre_get_posts ? (scribu)
   3. query_posts with custom taxonomy and custom post type
      (Christian Foster)
   4. Re: query_posts with custom taxonomy and custom post	type (Otto)
   5. Re: query_posts with custom taxonomy and custom post	type
      (Christian Foster)
   6. Re: query_posts with custom taxonomy and custom post type
      (Michael Pretty)
   7. Re: query_posts with custom taxonomy and custom post	type
      (John Bloch)
   8. Re: query_posts with custom taxonomy and custom post	type
      (Christian Foster)
   9. Re: query_posts with custom taxonomy and custom post type
      (Dougal Campbell)
  10. Re: query_posts with custom taxonomy and custom post	type
      (Christian Foster)
  11. Regarding wp markup language (sutharshan balachandren)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 Apr 2010 08:47:03 -0500
From: Almost George WP-Hackers List
	<wp-hackers-list at almostexciting.com>
Subject: Re: [wp-hackers] Using Meta Keys with pre_get_posts ?
To: wp-hackers at lists.automattic.com
Message-ID:
	<i2m59710fc71004150647ld222903odf75605c17f4fa7f at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Apr 15, 2010 at 2:13 AM, scribu <scribu at gmail.com> wrote:
> Checking a single meta key value is easy:
>
>
> function check_meta_key($wp_query) {
> ? ?$wp_query->set('meta_key', 'my_key');
> ? ?$wp_query->set('meta_value', 'my_value);
> }
> do_action('parse_query', 'check_meta_key');
>

Thanks! Is it possible to use conditionals, like "less than" or "not
equal to" here? What might that look like?


------------------------------

Message: 2
Date: Thu, 15 Apr 2010 15:42:43 +0000
From: scribu <scribu at gmail.com>
Subject: Re: [wp-hackers] Using Meta Keys with pre_get_posts ?
To: wp-hackers at lists.automattic.com
Message-ID:
	<h2h349fe48b1004150842ya597bb04pf365fdc9633351ad at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Thu, Apr 15, 2010 at 1:47 PM, Almost George WP-Hackers List <
wp-hackers-list at almostexciting.com> wrote:

> On Thu, Apr 15, 2010 at 2:13 AM, scribu <scribu at gmail.com> wrote:
> > Checking a single meta key value is easy:
> >
> >
> > function check_meta_key($wp_query) {
> >    $wp_query->set('meta_key', 'my_key');
> >    $wp_query->set('meta_value', 'my_value);
> > }
> > do_action('parse_query', 'check_meta_key');
> >
>
> Thanks! Is it possible to use conditionals, like "less than" or "not
> equal to" here? What might that look like?
>


For that, you'll have to use the 'posts_where' filter.

Take a look at how it's done in the Custom Fields Taxonomies plugin which
supports this:

http://wordpress.org/extend/plugins/custom-field-taxonomies/



-- 
http://scribu.net


------------------------------

Message: 3
Date: Fri, 16 Apr 2010 03:09:00 +1000
From: Christian Foster <christian.foster at gmail.com>
Subject: [wp-hackers] query_posts with custom taxonomy and custom post
	type
To: wp-hackers at lists.automattic.com
Message-ID:
	<r2x89a1851d1004151009o9064f3ecyaf1d0ff5e957d2a6 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I'm having a bit of trouble getting what I understand should be the
correct functionality out of WP_Query with custom taxonomies and
posts.

This code gets 10 posts of all types that are linked to the term_name;

global $wp_query;
query_posts( array(
    "taxonomy_name" => "term_name",
    'showposts' => 10 )
);

This code gets 10 posts of custom post type "message";

global $wp_query;
query_posts( array(
    'post_type' => 'message'
    'showposts' => 10 )
);

This code however always ignores the post_type requirement but still
selects all post types linked to the term_name;

global $wp_query;
query_posts( array(
    'post_type' => 'message' ,
    "taxonomy_name" => "term_name",
    'showposts' => 10 )
);

>From everything I have read the last section of code should work as
expected - is it incorrect?

Regards,

Chris.


------------------------------

Message: 4
Date: Thu, 15 Apr 2010 12:40:24 -0500
From: Otto <otto at ottodestruct.com>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post	type
To: wp-hackers at lists.automattic.com
Message-ID:
	<x2n161617691004151040q36aa085br46f064c73eac3ad4 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Apr 15, 2010 at 12:09 PM, Christian Foster
<christian.foster at gmail.com> wrote:
> This code however always ignores the post_type requirement but still
> selects all post types linked to the term_name;
>
> global $wp_query;
> query_posts( array(
> ? ?'post_type' => 'message' ,
> ? ?"taxonomy_name" => "term_name",
> ? ?'showposts' => 10 )
> );
>
> From everything I have read the last section of code should work as
> expected - is it incorrect?

The post_type is ignored for taxonomy based queries. See trunk,
query.php, line 2034.

-Otto


------------------------------

Message: 5
Date: Fri, 16 Apr 2010 04:08:31 +1000
From: Christian Foster <christian.foster at gmail.com>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post	type
To: wp-hackers at lists.automattic.com
Message-ID:
	<p2w89a1851d1004151108h89a1452aqd00dc320db717887 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Thanks Otto.

Are there any recommended strategies for achieving the desired result?
I would have thought this would be commonly used (or needed)
functionality, or is it something that will make it into the final
release? I can't think of any solution that will play nice with
wordpress paging and be as simple as possible.


------------------------------

Message: 6
Date: Thu, 15 Apr 2010 14:09:44 -0400
From: Michael Pretty <mpretty at voceconnect.com>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post type
To: wp-hackers at lists.automattic.com
Cc: Christian Foster <christian.foster at gmail.com>
Message-ID: <4BC75668.1080202 at voceconnect.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Submit a ticket (and maybe a patch) to trac.  This shouldn't be this way.

On 4/15/10 2:08 PM, Christian Foster wrote:
> Thanks Otto.
>
> Are there any recommended strategies for achieving the desired result?
> I would have thought this would be commonly used (or needed)
> functionality, or is it something that will make it into the final
> release? I can't think of any solution that will play nice with
> wordpress paging and be as simple as possible.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>    



------------------------------

Message: 7
Date: Thu, 15 Apr 2010 14:11:16 -0400
From: John Bloch <jbloch at olympianetworks.com>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post	type
To: wp-hackers at lists.automattic.com
Message-ID: <A259B1B7-C06D-4006-86A1-A0BC1AEA4E8B at olympianetworks.com>
Content-Type: text/plain; charset=us-ascii

If you register the taxonomy only for your custom post type, it will only return that post type.

On Apr 15, 2010, at 2:08 PM, Christian Foster wrote:

> Thanks Otto.
> 
> Are there any recommended strategies for achieving the desired result?
> I would have thought this would be commonly used (or needed)
> functionality, or is it something that will make it into the final
> release? I can't think of any solution that will play nice with
> wordpress paging and be as simple as possible.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



------------------------------

Message: 8
Date: Fri, 16 Apr 2010 04:18:31 +1000
From: Christian Foster <christian.foster at gmail.com>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post	type
To: wp-hackers at lists.automattic.com
Message-ID:
	<k2v89a1851d1004151118xb0ed2723pa6bb12aeb3693e57 at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Will do.

> Submit a ticket (and maybe a patch) to trac.  This shouldn't be this way.


------------------------------

Message: 9
Date: Thu, 15 Apr 2010 15:36:45 -0400
From: Dougal Campbell <dougal at gunters.org>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post type
To: wp-hackers at lists.automattic.com
Message-ID: <4BC76ACD.4090301 at gunters.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On Apr 15 2010 2:09 PM, Michael Pretty wrote:
> Submit a ticket (and maybe a patch) to trac.  This shouldn't be this way.
>

I agree. Making a query against custom taxonomy and custom post_type 
shouldn't be mutually exclusive. I think we just need to wrap an 'if' 
around that...

   if ( '' === $post_type ) {
     $post_type = 'any';
   }

That way, if the user has specified a particular post type, it will be 
honored, but it will default to 'any'.

-- 
Dougal Campbell <dougal at gunters.org>
http://dougal.gunters.org/
http://twitter.com/dougal
http://twitual.com/


------------------------------

Message: 10
Date: Fri, 16 Apr 2010 14:40:36 +1000
From: Christian Foster <christian.foster at gmail.com>
Subject: Re: [wp-hackers] query_posts with custom taxonomy and custom
	post	type
To: wp-hackers at lists.automattic.com
Message-ID:
	<u2v89a1851d1004152140t3c47103bs5d9aedf48babe9c at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Thanks for your help - submitted ticket.


------------------------------

Message: 11
Date: Fri, 16 Apr 2010 12:46:34 +0530
From: sutharshan balachandren <sutharshan02 at gmail.com>
Subject: [wp-hackers] Regarding wp markup language
To: wp-hackers at lists.automattic.com
Message-ID:
	<h2n3fa40cbc1004160016l3c94392fld8be82915b361ecc at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

This may be a stupid question, its just my thought.

When we design themes we are using the php tags and functions in between
them, which make little bit complicated for those who are not an expert in
themes creation. What I'm asking is that, will it be possible to create a
markup language for wp themes to connect this the other php files would be
easy in the designers view.

I know its possible to create new markup language like fbml. But i dont have
a clue how to do such thing. it is very hard to create a markup language?

Can anyone guide me to make new markup language?

thank you.

-- 
with love

Sutharshan


------------------------------

_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


End of wp-hackers Digest, Vol 63, Issue 33
******************************************


More information about the wp-hackers mailing list