The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
AI Assistant
Widget/Shortcode fo...
 
Notifications
Clear all

Question Widget/Shortcode for showing user's most recent comments?

5 Posts
3 Users
1 Reactions
250 Views
Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@daniellerch)
Active Member
Joined: 1 year ago
[#11549]

We are building a website that will be running wpDiscuz, wpForo, and LearnDash LMS -- so, we want users to have a single User Dashboard page where we can show them their own most recent activity from all three plugins. Is there a way to do this for wpDiscuz activity show via a shortcode or widget?


Topic Tags
4 Replies
1 Reply
wpDiscuz Support
Moderator
(@wpdiscuz-support)
Joined: 10 months ago

Member
Posts: 7
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Hi @daniellerch,

Great question! For wpDiscuz specifically, you're in luck — the plugin includes a Recent Comments widget that you can use to display a user's recent comments. However, since you're looking to aggregate activity from multiple plugins (wpDiscuz, wpForo, and LearnDash) on a single dashboard, you'll likely need a more comprehensive approach.

Here are a few strategies to consider:

  • Use wpDiscuz's Recent Comments Widget: This is the built-in solution for wpDiscuz activity, and it can be placed in a widget area on your dashboard page.
  • Create a custom dashboard page: You might want to explore using a page builder (like Elementor or Beaver Builder) combined with custom code to query user activity from all three plugins and display it in one unified view.
  • Check for dashboard plugins: There are some user dashboard plugins that work with multiple activity sources — you could look into whether any support all three of your plugins.
  • Custom shortcode development: If you have development resources, creating a custom shortcode that queries user activity across all three plugins would give you the most control and flexibility.

Have you already explored the wpDiscuz widget options, or are you specifically looking for a way to combine all three plugin activities into a single shortcode? That would help me point you toward the best solution for your setup.


Reply
Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@daniellerch)
Active Member
Joined: 1 year ago

Thanks! I actually did try using the Recent Comments tab in the wpDiscuz Widget that I see in Appearance > Widgets, but that seems to show *all* recent comments, whereas what I want is to show only the comments by the logged in user. Are you referring to a different widget?

(FWIW the theme is GeneratePress.)


Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 9 years ago

Illustrious Member
Posts: 8345
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@daniellerch 

Please try using the following hook code. Insert it into the active theme's functions.php file:

const WPD_RUO_CACHE_DOMAIN = "wpd_registered_only";

  function wpd_ruo_tag_recent_comments_args( $args ) {
      $args["cache_domain"] = WPD_RUO_CACHE_DOMAIN;

      return $args;
  }

  add_filter( "wpdiscuz_widget_recent_comments_args", "wpd_ruo_tag_recent_comments_args" );

  function wpd_ruo_filter_comment_clauses( $clauses, $query ) {
      if ( WPD_RUO_CACHE_DOMAIN !== ( $query->query_vars["cache_domain"] ?? "" ) ) {
          return $clauses;
      }

      global $wpdb;
      $clauses["where"] .= " AND {$wpdb->comments}.user_id > 0";

      return $clauses;
  }

  add_filter( "comments_clauses", "wpd_ruo_filter_comment_clauses", 10, 2 );

Instructions for adding custom code to WordPress:

https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/


Reply
Posts: 5
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@daniellerch)
Active Member
Joined: 1 year ago

Thanks; I just did that, cleared caches and reloaded -- but it does not seem to have made a difference. Was the intended purposes of this code to force the existing widget's "Recent Comments" tab to display only the current user's comments, or something else? 


Reply