User Tools

Site Tools


plugins:tabs_menus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
plugins:tabs_menus [2012/01/24 16:02]
mvlcek [Side Menu Creation Function]
plugins:tabs_menus [2013/04/19 15:04]
127.0.0.1 external edit
Line 42: Line 42:
 add_action('​plugins-sidebar','​createSideMenu',​array($thisfile,'​Setup Hello World','​setup'​));​ add_action('​plugins-sidebar','​createSideMenu',​array($thisfile,'​Setup Hello World','​setup'​));​
 add_action('​theme-sidebar','​createSideMenu',​array($thisfile,'​Show Hello World','​show'​));​ add_action('​theme-sidebar','​createSideMenu',​array($thisfile,'​Show Hello World','​show'​));​
 +</​code>​
 +
 +If you have multiple sidebar items like above, your main function (here //​hello_world_show//​) would look like this:
 +<​code>​
 +function hello_world_show() {
 +  if (@$_GET['​action'​] == '​setup'​) {
 +    ...
 +  } else if (@$_GET['​action'​] == '​show'​) {
 +    ...
 +  }
 +}
 </​code>​ </​code>​
  
Line 49: Line 60:
  
 <​code>​ <​code>​
-add_action('​nav-tab','​createNavTab',​array('​thetabname','​your-plugin-filename','​Menu Text', '​my-action'​));​+add_action('​nav-tab','​createNavTab',​array('​thetabname','​your-plugin-filename','​Tab Text', '​my-action'​));​
 </​code>​ </​code>​
  
-Use a unique name for the tab, e.g. your plugin name like 'newsmanager'. Also use this name for the page type in register_plugin(). The action parameter is again optional.+Use a unique name for the tab, e.g. your plugin name like //newsmanager//. Also use this name for the page type in ''​register_plugin()''​. The ''​action'' ​parameter is again optional.
 You can then add sidebar links for this tab with You can then add sidebar links for this tab with
  
Line 60: Line 71:
  
  
-Only use this function, if you need a lot of side bar links for you plugin and want to group them.+Only use this functionality, if you need a lot of side bar links for you plugin and want to group them.
plugins/tabs_menus.txt ยท Last modified: 2014/02/07 10:02 by datiswous