Title: Calling shortcodes using PHP
Last modified: October 16, 2019

---

# Calling shortcodes using PHP

 *  [outcold](https://wordpress.org/support/users/outcold/)
 * (@outcold)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/calling-shortcodes-using-php/)
 * I’m looking to use [bpps_profile_private_message_link]. I can use `<?php echo
   do_shortcode( '[bpps_profile_private_message_link]' ); ?>` but this doesn’t allow
   me to ad the ID `user_id=””` e.g. `$myuser_id`. Is it possible to call it as 
   a function?
 * Thanks so much for this great plugin.

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

 *  Thread Starter [outcold](https://wordpress.org/support/users/outcold/)
 * (@outcold)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/calling-shortcodes-using-php/#post-12033577)
 * This `echo do_shortcode( "[bpps_profile_private_message_link user_id=\"$myuser_id\"]");?
   >` works but would still like to know if it’s possible to call the shortcodes
   directly from within php.
 * Thanks 🙂
 *  [ruffpast](https://wordpress.org/support/users/ruffpast/)
 * (@ruffpast)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/calling-shortcodes-using-php/#post-12080032)
 * Hello,
 * Would you happen to know if you can call this shortcode through HTML? I am trying
   to use a plugin called PublishPress: Multiple Authors that allows you to have
   an author bio and click on the associated links below it. I figured I’d ask you
   since the plugin author for this hasn’t been active on the forum for months. 
   Here’s the code I tried:
 *     ```
       <a class="message" href="{{ do_shortcode('[bpps_profile_private_message_link]')|raw }}">
       <i href="{{ do_shortcode('[bpps_profile_private_message_link]')|raw }}" target="_blank"
       class="message-author" /><i class="ua-icon ua-icon-chat"> </i></a>
       ```
   
 * Thank you!
 * Mark

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

The topic ‘Calling shortcodes using PHP’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/bp-profile-shortcodes-extra_2e3232.
   svg)
 * [BP Profile Shortcodes Extra](https://wordpress.org/plugins/bp-profile-shortcodes-extra/)
 * [Support Threads](https://wordpress.org/support/plugin/bp-profile-shortcodes-extra/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-profile-shortcodes-extra/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-profile-shortcodes-extra/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-profile-shortcodes-extra/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [ruffpast](https://wordpress.org/support/users/ruffpast/)
 * Last activity: [6 years, 7 months ago](https://wordpress.org/support/topic/calling-shortcodes-using-php/#post-12080032)
 * Status: not resolved