Tagged: remove subject private message
Please try adding this to your bp-custom.php
add_action( 'wp_footer', function () { ?> <script type="text/javascript"> jQuery(document).ready(function ($) { if ($('#send_message_form #subject').length) { $('#send_message_form #subject').val('Some message subject'); } }); </script> <?php } );
Let me know if i works or not?
It assumes that the theme loads jQuery.
Regards
BrajeshHi Carsten,
You are welcome.
Are you not using the bp-legacy template? If you are using it, the compose screen will need page reload each time you want to compose a message. And if a page is loaded, the code should work fine.
Regards
BrajeshHi 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
CarstenHi Carsten,
Thank you for confirming. I am glad it worked.Regards
Brajesh
The topic ‘[Resolved] Remove the subject line requirement in messages?’ is closed to new replies.