[buddypress-trac] [BuddyPress] #4916: Wrong wording in activity
buddypress-trac
noreply at wordpress.org
Sat May 11 05:04:57 UTC 2013
#4916: Wrong wording in activity
--------------------------+---------------------
Reporter: chouf1 | Owner: chouf1
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 1.8
Component: Activity | Version: 1.7
Severity: minor | Resolution: fixed
Keywords: has-patch |
--------------------------+---------------------
Comment (by nacin):
Excellent use of `_nx()` here.
One thought: Generally numbers should be %d. But %s is actually correct
here, because it is possible (even probable, over time) for this number to
be in the thousands, which means it'll need a thousands separator. At
which point we need a number_format_i18n() in there. (Note only for the
sprintf() argument, not for the _nx() argument.)
It would probably make sense for bp_get_total_mention_count_for_user() to
only be called once. I also noticed that it defaulted to $user_id = 0, but
0 will end up just returning false down the stack in get_metadata() — so
it should either not be a default value, or a default of 0 should mean the
current user at some point before it reaches get_user_meta().
Final question — what is the purpose of bp_loggedin_user_id() and how is
it different from get_current_user_id()? As someone who knows WordPress
fairly well but BuddyPress not so well, it is not obvious why there are
wrapper functions such as this, and it makes it pretty difficult to wrap
your head around things. $bp->loggedin_user should probably just *be* the
$current_user object, and a function like this should probably just be
get_current_user_id(). I do see that there is a filter in there, but that
seems suspect.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4916#comment:6>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list