Title: bm button shortcode with variable
Last modified: March 14, 2023

---

# bm button shortcode with variable

 *  Resolved [hector0371](https://wordpress.org/support/users/hector0371/)
 * (@hector0371)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/)
 * Hello! I am trying to produce a button for vendors of woocommerce/dokan to chat
   with customer. The button should be displayed at the order-managing area for 
   the vendor. But how to make the button so that the vendor can chat with the customer？
   I can get $customer_id from $order easily, but how to pass that into the shortcode
   as “$user_id” ?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [wordplus](https://wordpress.org/support/users/wordplus/)
 * (@wordplus)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/#post-16556736)
 * Hi there!
 * Currently developing advanced integration with dokan. For now you can take a 
   look at do_shortcode function for generating shortcode dynamically.
 * Thanks!
 *  Thread Starter [hector0371](https://wordpress.org/support/users/hector0371/)
 * (@hector0371)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/#post-16557761)
 * [@wordplus](https://wordpress.org/support/users/wordplus/) Well, I have been 
   studying that shortcode several times. It seems that the only missing link is“
   passing the $customer_id into shotcodes` $user_id”.Is there a way to do so?
 *  Plugin Author [wordplus](https://wordpress.org/support/users/wordplus/)
 * (@wordplus)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/#post-16557871)
 * No I mean you can use this php function to wrap the shortcode and generate it
   dynamically:
   [https://developer.wordpress.org/reference/functions/do_shortcode/](https://developer.wordpress.org/reference/functions/do_shortcode/)
 *  Thread Starter [hector0371](https://wordpress.org/support/users/hector0371/)
 * (@hector0371)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/#post-16560537)
 * [@wordplus](https://wordpress.org/support/users/wordplus/) Sorry ，I read that
   article and did not see how that fit into the given purpose.Can you be more specific?
   Thanks!
 *  Thread Starter [hector0371](https://wordpress.org/support/users/hector0371/)
 * (@hector0371)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/#post-16562419)
 * Problem solved .To whom may be interested in this, here is the solution:
 * instead of [******* user_id=”$bp_customer_id”]
 * use [******* user_id=” ‘.$bp_customer_id’. “]

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘bm button shortcode with variable’ is closed to new replies.

 * ![](https://ps.w.org/bp-better-messages/assets/icon-256x256.png?rev=2835105)
 * [Better Messages - Chat Rooms, Group Chat, Private Messages & AI Chat Bots](https://wordpress.org/plugins/bp-better-messages/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/bp-better-messages/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/bp-better-messages/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-better-messages/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-better-messages/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-better-messages/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [hector0371](https://wordpress.org/support/users/hector0371/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/bm-button-shortcode-with-variable/#post-16562419)
 * Status: resolved