Skip to:

Re: Plugin: bbMenu 0.1 beta

Tip: you really need to stop repeating the errors that have been debugged for you.

You cannot do $rw["location"] == get_bb_location() because you are comparing (on the left hand side of the ==) the name of a function with (on the right hand side of the ==) the result of a function.

You could do:

if ( call_user_func($rw["location"]) == get_bb_location() ) {

// do something


But that’s probably not going to achieve what you’re trying to do because it’s going to depend on what the function actually does (whose name is stored in $rw[“location”]) … so if it returns a boolean value, then it’s not going to work because get_bb_location() returns a page name.

Incidentally the whole idea of storing the name of the function in the database is slightly more black belt than “noob” territory. You’d be better off storing a flag in the DB then translating the flag into a function name in the your code, because it’s more easily traced.

Isn’t there a simpler way?

Probably – describe in words (not code) exactly what you hope to achieve in the piece of code that is not working (this is often a healthy trick when something doesn’t work – by articulating the problem you can often recognize if you’ve overlooked something obvious or better in the design).

Skip to toolbar