Hello,
As far as I can see their is no clean way in 3.0b1 of doing this, but I’m not really a plugin/wordpress expert nor do I develop much.. Probably a more experienced developer could come up with a cleaner solution, but untill then you could use this :
Around the same line where you call the admin init hook you do
add_action("admin_enqueue_scripts",array(&$this,"testaddjs"));
(I’m assuming you’re using a plugin with class here)
In your pluginclass you put the function
function testaddjs($hook_suffix) {
global $typenow;
if ($typenow=="songtekst") {
echo "<script src='../wp-content/plugins/test.js' type='text/javascript'></script>";
}
}
where “songtekst” is your custom taxonomy’s slug. (for reference, hook_suffix is the page called, like post-new.php, and typenow is the post_type parameter in the url.
Good luck!
Edit : Interesting links :
3.0b1 /wp-admin/admin.php in svn
admin_enqueue_scripts as a 2.9 hook
add_action in the Codex Function Reference
Thanks so much for sharing this solution Wimsito.
I have been trying to do something similar, add CSS to the admin pages for just the a custom post type, and the code worked perfectly for that.
It is surprisingly easy to create a custom post type with a plugin, but tough to add a settings menu, icons, and other things to really customize that new post type.