Home > WordPress Menubar > Menubar 4.8 released

Menubar 4.8 released

September 13th, 2010 andrea Leave a comment Go to comments

This new Menubar version supports a new menu item type, named PHP. With this type you can dynamically generate a menu item using PHP code, so its applications are limited only by your imagination.

You can enter in the URL field any PHP code which returns your dynamically generated URL; you may also return an empty value, and in this case Menubar will generate no menu item at all.

A sample of the PHP code you can insert in the URL field is as follows:

// content of the URL field

$someurl = some expression;
$otherurl = other expression;

if (some-condition)
return $someurl;
else if (other-condition)
return $otherurl;
else
return '';

This PHP snippet generates:

a) a menu item pointing to $someurl if (some-condition) is met;
b) a menu item pointing to $otherurl if (other-condition) is met;
c) no menu item otherwise.

This is only a sample, you can use any PHP code and return the URL you need or no URL at all. Happy menus with Menubar!

Categories: WordPress Menubar
  1. No comments yet.
  1. No trackbacks yet.

Spam Protection by WP-SpamFree