[wp-hackers] Need Custom Post Type Rewrite Help, Please
Andrew Nacin
wp at andrewnacin.com
Sun Apr 18 23:22:08 UTC 2010
My bad all, I didn't catch that the first email was off-list.
Scribu's solution works fine, I was just sharing a new nifty function.
Nacin
On 4/18/10, Mike Schinkel <mikeschinkel at newclarity.net> wrote:
> On Apr 18, 2010, at 6:00 PM, Andrew Nacin wrote:
>> On Sun, Apr 18, 2010 at 5:47 PM, Mike Schinkel
>> <mikeschinkel at newclarity.net>
>> wrote:
>>
>>>> if ( is_post_type( 'financial-term', $id ) )
>>
>>> I assume this is sarcastic? If so, was there something I did wrong?
>>
>>
>> On Sun, Apr 18, 2010 at 5:52 PM, Mike Schinkel
>> <mikeschinkel at newclarity.net>
>> wrote:
>>
>>>> if ( 'financial-term' == get_post_type($id) )
>>>
>>
>>> Perfect! Thanks.
>>
>> No, it wasn't sarcastic. I'm also not sure how much more clear I could
>> have
>> gotten. I literally added is_post_type() today:
>> http://trac.wordpress.org/changeset/14158.
>>
>> Pass it a post type and a post, and it'll tell you if the post is of that
>> type -- that's exactly what scribu proposed for you, only it's simpler.
>>
>> The function is more powerful than that -- it can take an array of post
>> types to validate the post against. It can also take only a post type, and
>> it'll tell you whether that post type is indeed registered.
>
> Sorry, I had a brain-lapse. I elaborated in a private email.
>
> -Mike
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list