[buddypress-trac] [BuddyPress Trac] #7234: Implement get_object_by_id() method in message factory

buddypress-trac noreply at wordpress.org
Tue Aug 30 15:42:43 UTC 2016


#7234: Implement get_object_by_id() method in message factory
------------------------------+------------------
 Reporter:  jdgrimes          |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  2.7
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |
------------------------------+------------------

Comment (by boonebgorges):

 @jdgrimes Thanks for the patch!

 The technique you've used for fetching the message ID after creation is
 not quite right. `messages_new_message()` returns a *thread* ID. In fact,
 I don't think there's a way to get the ID of the created message from the
 return value of `messages_new_message()`. Needless to say, this is truly
 awful. But we can fix the factory by fetching the last item in the
 thread's `messages` array (`end()`). Let's maybe try to break
 `messages_new_message()` into pieces in a different thread (no pun
 intended).

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7234#comment:6>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list