Skip to:

How does bbPress handel: double variables?

  • Hi,

    I am in the proces of making a nice menu plugin. It has al the features like drag & drop etc etc. This works great. Now I want pluginbuilders, who have made a plugin and use a new page like the memberlist plugin, to be able to easy add their page to the menu.

    I would like to do something like this (dont mind the wrong syntaces, its for some easy explaining):

    In my menu.php plugin page I’ve added something like:

    function get_menu_pages ()

    select $menu_titel, $menu_page from bb_menu where blablabla

    I need 2 variables now: $menu_titel and $menu_page

    A new plugin adds in its plugin page these variables:

    Excample: memberlist plugin

    $menu_titel = Memberlist

    $menu_page = memberlist.php

    This works, no problem so far, but what happens if in another plugin page is added:

    Excample: FAQ plugin

    $menu_titel = FAQ

    $menu_page = faq.php

    How will function get_menu_pages () react? Will it only get the first variable from the memberlist plugin, or will it get both, or will it simply crash. Is this even possible at all?

    The reason I want to do it this way, is that plugin builders can easily add their page to my menu plugin by simply filling in the $menu_titel and $menu_page variables on their own plugin page.

    Hope this makes any sence and if this doesn’t work, what solutions are there for this?

Viewing 7 replies - 1 through 7 (of 7 total)

  • thomasklaiber


    Maybe using a array? Like

    $menu['FAQ'] = 'faq.php';

    Passing this through a filter so everybody can add his links via filter in his plugin…



    Anything is possible.

    Instead of doing it the way you’re suggesting, why not have what you’re doing interact with s010’s site options plugin and let the end user add what pages he wants to the menu system. Then you simply put the values needed into an array and foreach them out dynamically. The user can call the pages whatever they want and link to whatever page they want in the menu.

    Well they way I want it, makes it possible to auto update the available menu links… Or it has to check every plugin page if it has a page available…

    Perhaps its easier to ask this question when I release the plugin…



    Perhaps, but if you’re looking for ease, it’s WAY easier to get the user to add what they want than to ask all plugin creators to add variables into their plugins. The second request is probably unreasonable even… especially when bbpress REALLY takes off and there are 98120948124 plugins available.

    unreasonable request….. ow sorry :(



    I was referring to scale. Unless it’s in the core, it’s too large to expect others to make their code friendly with your code. If you have a thousand plugin authors and 10% of them do that, it just seems unreasonable that the other 900 will add 100 different things to their code to be friendly with other plugins. And if those 10% each write multiple plugins that way, it’s even MORE things the other 900 have to add to all their plugins.

    It’s nothing against YOU, it’s just that you have to think about scale, and what you’re asking isn’t scalable.

    Np dude,

    Think I am going to release a tutorial when releasing the plugin, explaining how people can add their plugin(page) to the menu. THinks thats the best approach for now!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar