Replies
Hi Brajesh, I will check that out, thanks
Hi Brajesh here are 2 screenshots of what is going on. My point is, that the bp_send_private_message_button is acting correctly, except on visitors page, by only showing on profile pages. I hope this makes sense.
Using the hook: bp_after_member_body:
https://domain/members/jeff/
https://imgur.com/HnxO0UmSend message button also displayed on https://domain/members/jette/visitors/
https://imgur.com/5HnLv2kHere of course the button is inactive, but is displayed.
Regards
Carsten- calu on March 27, 2020 at 11:28 am in reply to: [Resolved] Remove the subject line requirement in messages? #28384
Hi Brajesh, the code is working now, again, thank you very much for the extraordinary help and support you are offering.
Best
Carsten - calu on March 26, 2020 at 11:47 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28383
Adding the original code, didn’t help.
I figured it out, what this code snippet does is to link both the avatar and the user name, in the message thread, to the conversation instead of the profile
- calu on March 26, 2020 at 11:39 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28382
Hi Brajesh, yes, I’m using bp-legacy template. This happens after visiting and writing a new profile so the page must be reloaded.
I found this edit in my messages-loop.php in my child theme, kan this cause this. Honestly, I can’t remember why this code was added, and what it does?
<?php $mssender = strip_tags(bp_get_message_thread_from(), '<br>'); ?> <span class="from"><?php _e( 'From:', 'buddypress' ); ?></span> <?php bp_message_thread_from(); ?> <a href="<?php bp_message_thread_view_link( bp_get_message_thread_id(), bp_displayed_user_id() ); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( "View Message", 'buddypress' ); ?>" aria-label="<?php esc_attr_e( "View Message", 'buddypress' ); ?>"><?php echo $mssender; ?><span class="activity"><?php bp_message_thread_last_post_date(); ?></span></a>
Original code:
<span class="from"><?php _e( 'From:', 'buddypress' ); ?></span> <?php bp_message_thread_from(); ?>
Regards
Carsten - calu on March 26, 2020 at 11:16 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28380
Hi Brajesh, thanks for the code, which works once, on the first new message but not on following new message?
- calu on March 26, 2020 at 11:04 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28378
Hi, I can see I have got a syntax error here?
Uncaught SyntaxError: Invalid or unexpected token
jQuery(document).ready(function() {
jQuery(‘#send_message_form’).submit( function() {
jQuery(‘#subject’).val(“Some message subject”);
});
}); - calu on March 26, 2020 at 10:57 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28377
My theme also supports setting in custom hooks like one of the BP action hooks
- calu on March 26, 2020 at 10:53 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28376
Hi Brajesh, thanks for your quick reply, actually it is my theme developer who is asking, if if this script can be added using the wp_footer hook, which my theme supports
- calu on March 26, 2020 at 9:51 pm in reply to: [Resolved] Remove the subject line requirement in messages? #28370
Hi Brajesh, turning back to core BP Messages, it is relevant for me again to get a solution to the auto fill out the Subject field. I never got it to work in Legacy.
Earlier you wrote:
“Since it is just 2 lines of code, My suggestion will be to put it in one of the js file provided by theme. Look for a file named buddypress.js and you can put the code inside the dom ready section there. If you are using a custom theme, you may ask there(or check their documents) to see if there is any custom js file supported.”I have got an answer from the theme developer about where to add the js:
“Definitely wouldn’t suggest adding that to the theme’s file as it will be erased during updates.
Can you check with them to see if it can be added using wp_footer hook?”As I understand, this is not done by adding the code to a js folder with a buddypress.js file in my childtheme to solv the erasure issue.
Would it be possible to add the code using the wp_footer hook as suggested, or which hook should I use?
Regards
Carsten