[wp-hackers] Adding custom taxonomies as submenus to custom admin top-level menu

Daniel Bachhuber danielbachhuber at gmail.com
Sun Aug 1 02:07:53 UTC 2010


Awesome, that was exactly it:

http://plugins.trac.wordpress.org/changeset/270140/assignment-desk

I think I was initially sent off track because I forgot user  
permissions and then it went downhill from there.

Thanks again,

Daniel

On Jul 31, 2010, at 9:48 PM, Mike Schinkel wrote:

> On Jul 31, 2010, at 9:21 PM, Daniel Bachhuber wrote:
>> Here's what I ended up doing:
>>
>> http://plugins.trac.wordpress.org/changeset/270119/assignment-desk
>>
>> It's not ideal that the menu items don't show up under our custom  
>> menu but this is functional enough for the time being (especially  
>> because I'll need to do a bit more hacking to get taxonomies to  
>> work with Users).
>>
>> Thanks for your help,
>>
>
> Daniel
>
> Try this (integrated into your code, of course):
>
> class AssignmentDesk {
> 	static function on_load() {
> 		add_action('admin_action_assignment-desk',array(__CLASS__,  
> 'general_settings'));
> 		add_action('admin_menu', array(__CLASS__,'admin_menu'));
> 	}
> 	function general_settings() {
> 		echo 'Do your settings here';
> 	}
> 	static function admin_menu() {
> 		add_menu_page('Assignment Desk', 'Assignment  
> Desk','manage_options','assignment-desk',array(__CLASS__,  
> 'general_settings'));
> 		add_submenu_page('assignment-desk', 'Pitch Statuses', 'Pitch  
> Statuses', 'manage_options', 'edit-tags.php?taxonomy=pitch_status');
> 		add_submenu_page('assignment-desk', 'User Types', 'User Types',  
> 'manage_options', 'edit-tags.php?taxonomy=user_type');
> 		add_submenu_page('assignment-desk', 'User Roles', 'User Roles',  
> 'manage_options', 'edit-tags.php?taxonomy=user_role');
> 	}
> }
> AssignmentDesk::on_load();
>
> -Mike
> P.S. I notice Assignment Desk the other day.  Planning to watch your  
> progress, good luck!
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

--
Daniel Bachhuber
www.danielbachhuber.com
danielbachhuber at gmail.com
cell: +1 971 998 5407
aim/skype/twitter: danielbachhuber



More information about the wp-hackers mailing list