Front End PM

Print

Front End PM – bbPress Integration


a Send Message link can be easily add under User name in bbPress replies. When any user will click that link s/he will be redirected to message page with pre-populate with that user name and that Reply title as Subject.

Add following code in your theme’s (child theme’s if any) functions.php

 

add_action( 'bbp_theme_after_reply_author_details', function() {

    $user_nicename = get_the_author_meta('user_nicename');

    if( ! $user_nicename || ! fep_current_user_can('send_new_message_to', $user_nicename ) ){
        return '';
    }
    ?>
        <div class="fep-bp-send-message"><?php echo do_shortcode( "[fep_shortcode_message_to class='fep-bp-send-message-a']"); ?></div>
    <?php
});