Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: bb_get_option_{option_name} noob questions

The speed difference is negligable.

I would always use bb_get_option() so that a “power-user” can softcode the option value into the $bb variable if they want to avoid the extra database hits. bb_get_option_from_db() is mostly useful when you want to override data that has been softcoded (which probably isn’t very often).

PS: bb_get_option() is the function, ‘bb_get_option_{blah}’ is the filter.

bb_get_option( ‘my_option’ ) grabs the value for my_option and filters it through anything you’ve defined in the ‘bb_get_option_my_option’ filter. The filter is probably pretty useless for data that plugins store since you probably won’t have to modify on the fly the data that you provided in the first place.

The filter may be useful for data the core bbPress provides (you might want to filter ‘bb_get_option_page_topics’, for example, so that whenever bbPress core calls bb_get_option( ‘page_topics’ ), you can modify the returned value on the fly).

Skip to toolbar