[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:48:22 UTC 2018
#7847: bp_after_message_content hook not working with BP Nouveau
------------------------------+-----------------------
Reporter: pareshradadiya | Owner: imath
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 3.1.0
Component: Messages | Version:
Severity: normal | Resolution:
Keywords: has-patch commit |
------------------------------+-----------------------
Comment (by imath):
In [changeset:"12121" 12121]:
{{{
#!CommitTicketReference repository="" revision="12121"
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
See #7847 (Trunk)
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7847#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list