[wp-hackers] Custom Taxonomies for Pages

Dion Hulse (dd32) wordpress at dd32.id.au
Sun Aug 30 23:47:11 UTC 2009


On Mon, 31 Aug 2009 07:59:17 +1000, Dion Hulse (dd32)  
<wordpress at dd32.id.au> wrote:

> On Sun, 30 Aug 2009 23:43:30 +1000, scribu <scribu at gmail.com> wrote:
>
>> On Sun, Aug 30, 2009 at 3:35 PM, Jason <jason at findingsimple.com> wrote:
>>
>>> Hi All,
>>>
>>> I am trying to get a custom taxonomy tag panel on the "Edit Page" page  
>>> in
>>> the dashboard - just like the regular tags panel for the "edit posts"  
>>> page
>>> except for a custom taxonomy.
>>>
>>> My understanding is that WP does not do all the automatic stuff for  
>>> custom
>>> taxonomies relating to pages at the moment.
>>>
>>> So what I have done is an add an additional meta box and told it to  
>>> display
>>> a tweaked version of the core add tag panel but I can't seem to get it  
>>> to
>>> make the ajax (?) calls to populate it properly/edit the tags  
>>> properly. Do
>>> I
>>> need to add some extra java to the "Edit Page" page or something?
>>>
>>> Thoughts, suggestions, help?
>>>
>>> You can view the functions I am using
>>> here.<http://findingsimple.com/dev/tax.txt>
>>>
>>
>> Firstly, the tags are not populated by AJAX. They are saved when the  
>> post is
>> saved.
>>
>> So you will need to add a hook somewhere to save the page tags.
>>
>> There is some javascript that "enhances" the tag box. To add it, add the
>> following line to the 'admin_enqueue_scripts' action:
>>
>> wp_enqueue_script('post');
>
> That'll only work for the post_tag taxonomy however. I've been working  
> on converting everything to handle custom taxonomies better.. but.. not  
> sure  when there'll be a working patch available :)

oops. I think thats for the Category stuff only.. Ie. the Tag stuff does  
work with other tax's..


-- 
--
Dion Hulse
e: contact at dd32.id.au
w: http://dd32.id.au/
m: 04 6621 9112 (+614 6621 9112)
WordPressQI: http://wordpressqi.com/


More information about the wp-hackers mailing list