Skip to:
Content

Opened 7 years ago

Closed 7 years ago

#691 closed enhancement (fixed)

bb_get_usermeta()

Reported by: fel64 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Back-end Keywords:
Cc:

Description

Is there such a function? If not, can it be added? Although it's a simple query to get the usermeta value, it would be nice to have a wrapper for it, especially if it works with the cache. I don't understand how the cache works and have trouble following the existing meta functions, otherwise I would have tried to write something myself.

Change History (4)

comment:1 mdawaffe7 years ago

All usermeta data are appended to the user objects you get from bb_get_user() (and are cached).

Example:

$user = bb_get_user( 3 );
echo $user->topics_replied; // or whatever meta_key you want.

Knowing that, if you still need a bb_get_usermeta() function, can you explain what you need it for?

comment:2 fel647 years ago

Nope. :) This is better, thank you.

It's updated, too, isn't it, when bb_add_usermeta is called?

comment:3 mdawaffe7 years ago

Yes - the cache is updated. Any objects you've got hanging around previously created by bb_get_user() are not automatically updated; those are real variables, not references.

And actually, I think convenience functions will be useful.

comment:4 mdawaffe7 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [904]) bb_get_usermeta(), bb_get_topicmeta(). Bothe require meta_key. Fixes #691

Note: See TracTickets for help on using tickets.