Hi there, I want to insert this callback, but I’m uncertain which file I should use
remove `// remove the action
remove_action( ‘bp_messages_bulk_management_dropdown’, ‘action_bp_messages_bulk_management_dropdown’, 10, 0 ); `In http://hookr.io/, the action is defined in the following location.
/bp-messages/bp-messages-template.php
do_action( ‘bp_messages_bulk_management_dropdown’ );Can I create this thread > bp-messages/bp-messages-template.php, in my child theme, or can I insert it in
bp-templates>bp-legacy>buddypress>members>single>messages>messages-loop.php
or
bp-templates>bp-legacy>buddypress>members>single>messages.php ?
Thanks
Regards
CarstenHi Carsten,
It will be nice if you can tell me what are you trying to achieve? removing the bulk action box?I can help better in that case.
regards
BrajeshHi Brajesh, sorry for not being clear enough, my goal is to remove certain elements like the message select drop down and message star options. I can hide it with css, but would prefer to remove it instead.
Hi Carsten,
No issues.
In that case, My suggestion will be to do the template override.you can copy the template from plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages to yourtheme/buddypress/members/single/messages and modify them as you please.
Regards
BrajeshHi Brajesh, no issues, I was not sure which file I should overwrite.
Just to clarify, then you never or can not?, overwrite
buddypress, bp-messages, eg. bp-messages-star.php,
but always via template, bp-templates eg. bp-legacy, buddypress, members, single, messages.php – or single, messages, message.php or messages-loop.php?
When you overwrite a file to your child theme, like messages.php, it does not get overwritten, but that means also, that it does not get updated neither?
Regards
CarstenHi Carsten,
You can override templates but not the core files of a plugin.For BuddyPress, things inside the bp-templates are part of template and can be overridden(with the template pack acting as root).
For your case, the dropdown is in messages-loop.php
<div class="messages-options-nav"> <?php bp_messages_bulk_management_dropdown(); ?> </div><!-- .messages-options-nav -->
Regards
BrajeshHi Brajesh, thank you very much for the clarification and help on the subject, it’s working great.
I want to overwrite other objects in the templates eg. the thread star, what is the easiest way to look up the corresponding template to an object, are these listed somewhere, or do I just have to look them up?
Regards
CarstenHmm, ran into an issue, the dropdown is gone, but there must be a syntax error some were, or I positioned the remove action wrong, because it breaks the messages module?
<div class="messages-options-nav"> <?php // remove the action remove_action( 'bp_messages_bulk_management_dropdown', 'action_bp_messages_bulk_management_dropdown', 10, 0 ); ?> </div><!-- .messages-options-nav --> <?php wp_nonce_field( 'messages_bulk_nonce', 'messages_bulk_nonce' ); ?> </form> <?php
- This reply was modified 4 years, 6 months ago by calu.
Hi Carsten.
Why are you putting remove action.If template override works, you do not need the remove actions.
Add/remove actions are suitable when you can not modify the code directly. The allow you to hook/unhook in that case.
Regards
Brajesh
The topic ‘ [Resolved] Insert callback location’ is closed to new replies.