Adding Link to Admin bar
-
I built a image/video gallery for my own use. I didn’t build as a plug-in. I wrote it and plugged in the code where approipiate for it to work. But I’d like to port it to a plug-in structure.
I’m curious how to add an extra menu item on the fly to menu.php. As you can see I hard coded ” array(__(‘Galleries’), 1, ‘galleries.php’) ” into the array from menu.php:
$menu = array(
array(__(‘Write’), 1, ‘post.php’),
array(__(‘Edit’), 1, ‘edit.php’),
array(__(‘Galleries’), 1, ‘galleries.php’),
array(__(‘Categories’), 3, ‘categories.php’),
array(__(‘Links’), 5, ‘link-manager.php’),
array(__(‘Users’), 3, ‘users.php’),
array(__(‘Options’), 6, ‘options-general.php’),
array(__(‘Plugins’), 8, ‘plugins.php’),
array(__(‘Templates’), 4, ‘templates.php’),
array(__(‘Upload’), get_settings(‘fileupload_minlevel’), ‘upload.php’),
array(__(‘Profile’), 0, ‘profile.php’)
);Then in galleries.php I added Video & Image to the ‘adminmenu2’ options. The sub menu is easy cause it’s added in the file called but how ho I add items to the main menu when a plugin is activated? Thanks!
- The topic ‘Adding Link to Admin bar’ is closed to new replies.