[wp-hackers] Best approach

Diana K. Cury dianakac at gmail.com
Wed Sep 28 17:41:49 UTC 2011


Thanks a lot!

----- Original Message ----- 
From: "Mike Little" <wordpress at zed1.com>
To: <wp-hackers at lists.automattic.com>
Sent: Wednesday, September 28, 2011 8:32 AM
Subject: Re: [wp-hackers] Best approach


> On Wed, Sep 28, 2011 at 03:43, Diana K. Cury <dianakac at gmail.com> wrote:
>
>> Thanks for your reply,
>>
>> I still can't find a way to populate the taxonomies assigning the parent, 
>> I
>> thinks there´s no way to do so.
>>
>>
>>
> Assuming 'mytaxonomy' is defined to be hierarchical:
>
> $parent_term = wp_insert_term( 'My Term Name', 'mytaxonomy', array(
> 'description' => 'Some description', 'slug' => 'my-term-name' ) );
>
> $term = wp_insert_term( 'My Child Term', 'mytaxonomy', array( 
> 'description'
> => 'Some child description', 'slug' => 'my-child-term', 'parent' =>
> $parent_term['term_id'] ) );
>
>
>
> Mike
> -- 
> Mike Little
> http://zed1.com/
> _______________________________________________
> 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