I have a Bakery page. Every time I add a child page such as cakes, I would like to add the page title cakes to a custom taxnomy. I also want to add this child page to a menu which displays these child pages.
I have found out that I need to hook into the new_page. So something like this,
function($page_id){
check if this page is type of page and parent_page is Bakery Page's ID
If yes, then add this page to menu which displays the child pages. I suppose I need the ID of the menu but I do not know how to find it, not even to hard code it.
Lastly I want to add the title of this page to a custom taxonomy.
}
Can you help?
add_action('new_auto-draft', 'callback');, and kind of useless for your need. You are asking two very different questions (add-to-menu & create-custom-taxonomy). For the second one research this. I'm voting to close the Q, and suggest you to refactor it focusing in one item, and putting more research in it. And opening a new one for the other. .... Nice trick, to put more text into pseudo-code :) – brasofilo Dec 2 '12 at 2:43