[wp-hackers] Display tag admin box like categories, without hierarchy
John Blackbourn
johnbillion+wp at gmail.com
Thu Apr 5 14:34:33 UTC 2012
On 5 April 2012 15:22, Tom Barrett <tcbarrett at gmail.com> wrote:
> On 5 April 2012 09:51, Tom Barrett <tcbarrett at gmail.com> wrote:
>
>> Line 3 needs to be: add_action( 'add_meta_boxes', 'do_my_meta_boxes' );
>>
>
> Additionally, and quite sadly (for me), that doesn't work as is. WordPress
> core expects a different data structure for tags than for categories.
>
> Tags: mytaxonomy=Term Name 1,Term Name 2, Term Name 3
> Cats: mytaxonomy[]=array(term_id_1, term_id_2, term_id_3)
>
> Small steps :)
Ah yes, you're right. In that case you'll need a custom walker class
which outputs the term name instead of the term ID as the value
attribute on each checkbox. You can then pass that walker class in as
the 'walker' argument to wp_terms_checklist().
More information about the wp-hackers
mailing list