Shortcodes of Private Messaging not working right

I am using WP FORO with Private Messaging. The shortcodes do not want to work like they are supposed to. I can also not add a 'message me' link to the profile page.
Whenever I use shortcodes the inbox is all smushed together making it look ugly.

  • Jill
    • WPMU DEV Initiate

    HI! So, Samantha (love her) wrote my support ticket and i can't figure out how to edit it so I am writing here. I am no longer using WP Foro, I am now just using your forum and the shortcode that I have put in a widget to Message Me will not show up. I switched themes to make sure it wasn't that and it still wasn't working. I also deactivated all plugins and nothing (I'm mostly using all of your plugins anyway, so that makes sense). Anyway, Samantha mentioned my shortcode inbox problem above as well... I managed to make it look ok on big screens but not on little. Please help, this site goes live on Friday (big launch party so we gotta look good :0 ) Thank you so much!!!

  • Adam Czajczyk
    • Support Gorilla

    Hello Jill,

    I hope you're well today and thank you for your question. I also apologize for the delay on our side.

    I tried to access your site to check the issue but it seems that the support access that's been granted is no longer active. Could you please go to the "WPMU DEV -> Support" page in your site's backend and re-grant it for me? If it says it's still active, please revoke it and enable again, then let me know here.

    Kind regards,
    Adam

  • Jill
    • WPMU DEV Initiate

    HI, I just regranted it! The shortcode is in the art widget. I’d like each artist to have their own message me button. The page it should show looks like these: https://www.jarretthutton.com/artists/images/moon-child/ and the button should appear under TALK TO ME!

    I wanted to put it in their profiles too with php, but that isn’t working either. This is what their profiles look like https://www.jarretthutton.com/artists/users/artsysoul/

  • Adam Czajczyk
    • Support Gorilla

    Hello Jill!

    Thank you for enabling support access.

    I checked your site and read your conversation with Samantha again. There's some confusion because one of our devs suggested to use "in_the_loop" attribute for shortcode, so let me explain this.

    That's a good suggestion, assuming that the shortcode is used "within the loop", that means e.g is put into the post content. In such a case it would fetch a user from post author - so "message me" would mean sending a message to the post/page author.

    That argument, however, will not work anywhere "outside the loop" (you can read more about WordPress loop here: https://codex.wordpress.org/The_Loop). The "widget" is the place "outside the loop" always so that's why that doesn't work.

    The only way to go here would be to specify the "user_id" or "user_name", otherwise that will not work. I realize that this is somewhat problematic because in a widget you wouldn't be able to make that "user_id" or "user_name" assigned dynamically to the user so one workaround would be to move it from the widget to the user profile somehow.

    The other would require some custom coding because we would need first to find out about post id, then fetch that post's author and find out author's ID and then pass that ID to the shortcode. That can't be done on "front-end" and requires some PHP.

    That said, we do not provide custom coding services but fortunately that's quite an easy task so I created an additional widget for you. it will work with all the posts/pages on your site including custom posts and it will recognize the author of the post (so it should work with your "Images" posts) and dynamically create "Message me" button.

    Give it a try please. To use it on site:

    - download the .zip file that I attached to this post
    - extract it to your local drive
    - access your site via FTP (or cPanel "File Manager" tool)
    - upload "wpmu-private-messaging-widget-dynamic-message-me.php" file from extracted zip to the "/wp-content/mu-plugins" folder on your server (if there's no "mu-plugins" folder inside "wp-content" folder, just create it).

    Once you got it there, go to "Appearance -> Widgets" on your site and put the "Dynamic PM message me" widget into your "art" sidebar. That widget doesn't include any settings except "Title" and it should automatically fetch proper user.

    Give it a go and let me know how it worked for you, please.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.