[buddypress-trac] [BuddyPress Trac] #7847: bp_after_message_content hook not working with BP Nouveau

buddypress-trac noreply at wordpress.org
Fri May 25 03:52:10 UTC 2018


#7847: bp_after_message_content hook not working with BP Nouveau
------------------------------+---------------------
 Reporter:  pareshradadiya    |       Owner:  imath
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  3.1.0
Component:  Messages          |     Version:
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |
------------------------------+---------------------
Changes (by imath):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"12122" 12122]:
 {{{
 #!CommitTicketReference repository="" revision="12122"
 BP Nouveau: Improve Messages UI extensibility

 In BP Nouveau, the Messages UI is a Backbone based one. This means current
 legacy hooks inserted into the JS templates are a bit more different to
 use for plugin developers as it requires them to use JavaScript to get the
 data models. If the current AJAX requests still need a way to be extended
 to fetch extra data such as specific Messages metas, this commit is a
 first step to help plugin developers to insert content into the Messages
 UI without changing their habits about using the PHP Messages template
 global variables to get data about the Messages loop.  This is done by
 introducing the back compatibility function
 {{{bp_nouveau_messages_catch_hook_content()}}}. This function is used
 during the AJAX requests that are fetching messages for a specific thread.
 As a start, 2 legacy hooks have been moved from the JS Template level to
 this higher level :
 - {{{bp_before_message_content}}}
 - {{{bp_after_message_content}}}

 If actions are attached to these hooks their outputs will be caught using
 the buffer and will be "transported" as new properties, respectively
 {{{beforeContent}}} and {{{afterContent}}}, of the JSON reply that is used
 by the Messages UI. If these 2 properties are set and populated, their
 content will be output inside the corresponding JS templates.

 Props pareshradadiya

 Fixes #7847 (Branch 3.0)
 }}}

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


More information about the buddypress-trac mailing list