Cannot get pm_user shortcode working from within a template

Hi,

I'm trying to manually insert the send private message button in the bbPress templates. I know this can be achieved automatically via hooks but I'm opting to do it manually because I'd like to control some of the properties of the button.

Here's my code within loop-single-reply.php but nothing is showing.

<?php echo do_shortcode( '[pm_user user_id="2" in_the_loop="0" text="Send PM"]' ); ?>

When debugging, I swapped the shortcode for the message inbox and this worked perfectly so I'm guessing the pm_user shortcode might still need a little work?

Hope you can help,
Keith

  • Tyler Postle

    Hey there Keith,

    Hope you're doing well today!

    I'm just wondering what exactly you're trying to achieve. Where do you want the Send PM button to show up? Private Messaging comes with an Add-on to activate bbpress integration where it automatically places a private message button below all the user avatars.

    Are you wanting to place a PM button somewhere else in the forums? Once we know where you are wanting to place the button then we can help you get this all sorted :slight_smile:

    Look forward to hearing back!

    All the best,
    Tyler

    • kmvp

      Hi Tyler

      Thanks for getting back.

      There are a few reasons why I am opting for the manual integration instead of the automatic Add-on bbPress integration:

      1. My bbPress theme design uses bbPress actions and hooks on various places on the page (different from the norm). This causes the Send Message button to appear in two places and I only need it to appear once. See example here: http://www.mrs2be.ie/forums/topic/are-you-diying/
      I'm not going to remove the second do_action from my template as I plan to use it later.

      2. I need to be able to change the text from Message Me to another string. The shortcode apparently allows this.

      If you could assist debugging as to why this particular shortcode doesn't display, that would be great.

      Thanks
      Keith

      I want to be able to change the text from

  • kmalone

    Hi Tyler

    Thanks for getting back.

    There are a few reasons why I am opting for the manual integration instead of the automatic Add-on bbPress integration:

    1. My bbPress theme design uses bbPress actions and hooks on various places on the page (different from the norm). This causes the Send Message button to appear in two places and I only need it to appear once. See example here: http://www.mrs2be.ie/forums/topic/are-you-diying/
    I'm not going to remove the second do_action from my template as I plan to use it later.

    2. I need to be able to change the text from Message Me to another string. The shortcode apparently allows this.

    If you could assist debugging as to why this particular shortcode doesn't display, that would be great.

    Thanks
    Keith

  • Tyler Postle

    Hey Keith,

    Hope you're doing well today!

    Very sorry for my delay here. Have you got this sorted at all yet? I was just speaking with the developer and this should be working. Is the shortcode working for you on just normal pages?

    The bbpress add-on itself is actually just a wrapper for the shortcode.

    If you're still having issues could you grant support access so we can have a look?

    You can grant support access via admin dashboard - WPMU DEV > Support > Support Access > Grant Access.

    Look forward to hearing back!

    All the best,
    Tyler

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.