@astgh
I'm sorry to be a pest, but I guess I'm considered a non-coder here (just an above-average end-user). I checked out this article you mentioned, but the examples don't seem to be complete in a way that I feel confident I can reverse engineer one to fit my needs.
Would it be possible for you (or someone else on the team) to share an example code I can paste into my "Code Snippets" plugin to filter out the "post" CPT and just show my CPT "Lessons" (as "Recent Comments") using this hook you said was just added?
I am guessing it looks something like this below (with the help of ChatGPT), but as it's currently written, isn't working for me when I paste it in and activate it (it's still showing "Post" post type comments as well):
// Add a filter callback function
function custom_filter_recent_comments_args($args) {
// Check if the comments widget is being displayed
if (is_active_widget(false, false, 'wpdiscuz_recent_comments_widget', true)) {
// Modify the arguments to include your custom post type "Lessons" and exclude default post type
$args['post_type'] = array('lessons');
}
return $args;
}
// Hook the filter function to the wpdiscuz_widget_recent_comments_args hook
add_filter('wpdiscuz_widget_recent_comments_args', 'custom_filter_recent_comments_args');