Viewing 1 replies (of 1 total)
  • Plugin Author Ismail

    (@elhardoum)

    Hello,

    I am really sorry about the delay, I have been working on newer versions and I couldn’t keep an eye on my inbox for a while.. Apologize about this.

    You can add this code to your child theme’s functions file to make a shortcode:

    add_shortcode('wpc-link-to-chat', function($atts) {
    
    	$a = shortcode_atts( array(
    		'user_id' => wp_get_current_user()->ID
        ), $atts );
    
    	$user_id = (int) "{$a['user_id']}";
    	$wpchats = new wpchats;
    	return $wpchats->get_settings( 'messages_page' ) . "?recipient=$user_id";
    
    });

    And then you can use [wpc-link-to-chat user_id="{id_for_user_to_contact}"] or in PHP <?php echo do_shortcode('[wpc-link-to-chat user_id="3"]'); ?>..

    Hope that helps.

    Thanks.

    Regards,
    Samuel

Viewing 1 replies (of 1 total)
  • The topic ‘button directly to message a user’ is closed to new replies.