#7851 closed defect (bug) (fixed)
Alternative hook to bp_messages_inbox_list_item that can be used with BP Nouveau
Reported by: | pareshradadiya | Owned by: | imath |
---|---|---|---|
Milestone: | 3.1.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Templates | Keywords: | has-patch commit |
Cc: |
Description
I use bp_messages_inbox_list_item
to add <td>
in messages list on Inbox page.
The bp_before_member_messages_loop
callback function does not works when BP Nouveau template pack is enabled.
Here the code snippets of my use case:
<?php add_action( 'bp_messages_inbox_list_item', 'test_message_inbox_list_item' ); function test_message_inbox_list_item() { global $messages_template; $thread_id = isset( $messages_template->thread->thread_id ) && !empty( $messages_template->thread->thread_id ) ? $messages_template->thread->thread_id : ''; if ( !empty( $thread_id ) ) { $get_thread_data = test_get_message_data( $thread_id ); } // ...more custom code }
It would be great if BP Nouveau add similar hook that allow plugin developer hook custom function to show custom content in messages list.
Attachments (2)
Change History (15)
#5
@
6 years ago
- Keywords reporter-feedback 2nd-opinion added
@pareshradadiya After a deeper look and to be consistent with the choices we've made about the star/unstar action button, I think it's best to move the content you want to add into the new "Active Conversation" preview box so that we keep this messages list as simple as possible.
I'm suggesting the areas with red border I added to this screen capture :
The first one could be used to add a button just like we're doing for the star/unstar action. And the second one could be a <table>
to display the td
s plugin are adding using this bp_messages_inbox_list_item
hook.
@pareshradadiya && @hnla what do you think of this alternative ?
#6
@
6 years ago
7851.patch is doing what i've described above and introduces a new function to register Messages meta bp_messages_register_meta()
. This is needed to know what meta data to fetch. As @r-a-y played with messages meta with the Star feature, his opinion is very welcome :)
You'll need to apply 7847.3 & (probably) 7850.2 patches before this one to test
This ticket was mentioned in Slack in #buddypress by imath. View the logs.
6 years ago
#9
@
6 years ago
- Keywords needs-refresh added; reporter-feedback 2nd-opinion removed
After giving this ticket some more thoughts, I think introducing a function like bp_messages_register_meta()
in a minor release is not a good idea. I'll probably open a discussion about this kind of function into a new ticket for a future major release. For now i'm going to update the patch asap to only keep the part about adding custom content under the message content of the Active conversation preview.
#10
@
6 years ago
- Keywords commit added; needs-refresh removed
Working on 7851.2.patch, I've found there were a legacy hook to allow developers to add content before and after the message meta. I've added these 2 hooks to the "Ajax caught ones".
Thanks for your feedback. In Nouveau we do not use a table anymore but I understand the need, to maintain this level of customization in Nouveau we need to have a more granular approach about JS Templates i think.