Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem adding custom nav-tab
#1
I was trying to write a plugin which creates a top level nav-tab in the top navigation, but it's a pain in the ass. (Tried with 3.1 beta and 3.0)
I tried
Code:
add_action("nav-tab", 'createNavTab', array($thisfile, 'FooBar'));
but it doesn't seem to work right, cause when selecting the new tag, the plugin tag is highlighted too. (Cause the class of the new tab is "plugins", same as plugins tab's class)
In addition it is not possible to create a sidebar for this nav-tab.

One can inject html to show the custom nav-tab right, like
Code:
add_action("nav-tab",'MyCustomNavTab',array($thisfile,"My Tab"));
function SimpleBlogNavTab($name, $title){
    ?>
    <li><a class="<?php echo($name); ?>" <?php if (@$_GET['id'] == @$name): ?>style="/* highlight css */"<?php endif; ?> href="load.php?id=<?php echo($name); ?>"><?php echo($title); ?></a></li>
    <?php
}
but this is a very dirty way and there's still the problem that you can't add a sidebar.
It would be great if you could fix this in a 3.0.1 version or so, cause it is really very upsetting...
Reply


Messages In This Thread
Problem adding custom nav-tab - by ePirat - 2012-01-23, 16:57:09
Problem adding custom nav-tab - by mvlcek - 2012-01-23, 18:05:23
Problem adding custom nav-tab - by leenm - 2012-01-24, 17:33:40
Problem adding custom nav-tab - by shawn_a - 2012-03-07, 01:53:30
Problem adding custom nav-tab - by mvlcek - 2012-03-07, 02:30:33



Users browsing this thread: 2 Guest(s)