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 [2014/01/04 10:13]
Everyone [Side Menu Creation Function]
plugins:tabs_menus [2014/01/08 11:26]
Everyone [Side Menu Creation Function]
Line 13: Line 13:
 This way a new parameter **//​my-action//​** is added to the link so you can determine which link was clicked. This way a new parameter **//​my-action//​** is added to the link so you can determine which link was clicked.
  
-(3.1+) If you want a functionality like the "Edit Page" link which only shows if the function is active, add a 4th parameter in the params array as ''​false'':​+(3.1+) If you want a functionality like the "Edit Page" link which is only visible ​if the function is active, add a 4th parameter in the params array as ''​false'':​
  
 <​code>​ <​code>​
Line 22: Line 22:
 When you click the newly created menu link, the function you registered in ''​register_plugin()''​ will be called, and unless you specified the page your new menu link is on in the 7th argument of ''​register_plugin()'',​ the side menu will disappear. When you click the newly created menu link, the function you registered in ''​register_plugin()''​ will be called, and unless you specified the page your new menu link is on in the 7th argument of ''​register_plugin()'',​ the side menu will disappear.
  
-Thus if you add side bar links to two different tabs, you need to change this parameter dynamically,​ e.g. (setup on the plugins tab, other functionality on theme tab):+Thus if you add side bar links to two different tabs, you need to change this page type parameter dynamically,​ e.g. setup on the plugins tab, other functionality on theme tab:
  
 <​code>​ <​code>​
Line 60: Line 60:
  
 <​code>​ <​code>​
-add_action('​nav-tab','​createNavTab',​array('​thetabname','​your-plugin-filename','​Tab Text', '​my-action'​));​+add_action( '​nav-tab',​ '​createNavTab',​ array( '​thetabname',​ '​your-plugin-filename',​ 'Tab Text', '​my-action'​ ) );
 </​code>​ </​code>​
  
Line 67: Line 67:
  
 <​code>​ <​code>​
-add_action('​thetabname-sidebar',​ ...); // e.g. '​newsmanager-sidebar'​+add_action( '​thetabname-sidebar',​ ... ); // e.g. '​newsmanager-sidebar'​
 </​code>​ </​code>​
  
  
 Only use this functionality,​ 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