• Hi!

    I’m using collabpress to track my tasks and also to track my notes(comments) related to each task.

    Links to collabpress tasks’ comments are showing up in the “Recent Comments” widget in my home page’s sidebar.

    my site: wieldlinux.com

    Who else has run into this, and what did you do to solve it? I don’t want any trace of collabpress activity to show up on the front end… What can I do?

    What I’ve learned so far:
    I looked in the database and found out that collabpress uses WordPress’ native comments table to store the collabpress comments. And it gives them a comment_type of “collabpress” and marks their comment_approved flag as 1.

    What I’ve tried so far:

    1.
    I poked around the WordPress Dashboard in the Dashboard > Comments… panel, hoping for an option that would control which comments are shown on the front end (for example a filter by comments based on their comment_type– however I don’t see such functionality in the wordpress core…

    2.
    I looked in the Dashboard > Collabpress > settings to see if there’s any filter/control there that would somehow make the collabpress tasks’ comments unpublished to the front end but still show in the collabpress back end– but i don’t see such a setting…

    3.
    Trying to find what other people tried, I googled the term:
    wordpress filter comments on comment_type
    Which came up with link to this article:
    “Filtering by comment_type”
    http://wordpress-hackers.1065353.n5.nabble.com/Filtering-by-comment-type-td33174.html
    However this article talks about writing a plugin, and I didn’t see a resolution on the thread…

    I’m envisioning looking for a long-term or elegant solution, like a checkbox in the software config, or like another plugin that adds functionality, or something similar…

    So to recap my questions here,
    Who else has run into this, and what did you do to solve it?

    I don’t want any trace of collabpress activity to show up in the front end’s recent comments area… What can I do?

    Regards,
    Morgan

    https://wordpress.org/plugins/collabpress/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mjassen (mjjojo)

    (@mjjojo)

    Howdy!

    Update:

    If I go into the comments section of wordpress and mark the collabpress comment as pending (as opposed to approved), then it no longer shows up in the front end (not in the recent comments nor in the comments RSS feed). Great!

    Now how to make all collabpress comments by default become set to pending?…

    I learned it’s hardcoded in collabpress for comments to be approved. ( i.e. “…’comment_approved’ => 1,”… )

    as far as i can tell, in two places:
    collabpress/includes/menus/isset/comment.php
    and
    collabpress/includes/functions.php

    A quick workaround would be if collabpress by default set the comment_approved flag to 0…

    I’m not sure I’m ready to hack the plugin core to set this flag to 0 by default– I don’t want my added functionality to break next time I update the plugin.

    If I think of what to do next I’ll update this thread.

    What idea do you have to work around this?

    -Morgan

    Thread Starter mjassen (mjjojo)

    (@mjjojo)

    Thinking to make a (collab-press specific) helper plugin to set all comments with the type of ‘collabpress’ to 0 (pending) so that they don’t show up in the front end…

    The point of this plugin is envisioned to examine all comments being created in wordpress and if the comment type found is ‘collabpress’, then set approval to 0 (pending), otherwise leave its approval to alone.

    But what I have so far isn’t working. The plugin installs and activates but then when I make new comment in collabpress, the status still always stays at the default of 1 (approved/published) which makes it show on the front end in recent comments…

    The prototype of the plugin on github: https://github.com/mjassen/mzz-pendingcomment/blob/master/mzz-pendingcomment.php

    What is the next step to troubleshoot it to find why its not firing/working? is it that in the “add_filter(…” line, i need to programmatically pass it something other than ’99’ and ‘2’ as the last two parameters? Where would I look to find what it’s expecting to have passed to it instead of ’99’, ‘2’ ?…
    code:
    add_filter( 'pre_comment_approved' , 'mzz_cp_pendingcomment' , '99', '2' );

    Or could it be that I’m assuming that the pre_comment_approved hook gets called when collabpress creates a comment, but it really doesn’t? (here would I look to find whether it does or doesn’t?)

    Thoughts?

    -Morgan

    Thread Starter mjassen (mjjojo)

    (@mjjojo)

    Hiya!

    To address this issue, I’ve made a helper Plugin for CollabPress plugin for WordPress.

    I call it the “Mzz Pendingcomment” helper plugin. As comments are made the helper plugin sets CollabPress comments to pending.

    Features include:
    * overrides the default published-comment behavior of CollabPress. It sets comments to pending, so that the comments don’t show on the front end of one’s blog, neither under Recent Comments nor under Comments RSS.
    * Doesn’t modify core code, neither of CollabPress nor of WordPress.

    Note: Mzz Pendingcomment is born as an Open Source script. It’s home is here on GitHub: https://github.com/mjassen/mzz-pendingcomment

    Here’s how it works:
    1. Put the mzz-pendingcomment.php file into a folder called mzz-pendingcomment and upload the folder to the plugins directory in your WordPress installation.
    2. From the WordPress dashboard, activate the plugin.
    You’re done! Now any time someone creates a comment on a CollabPress task, the comment’s status will default to pending.

    Leo

    (@leoleylan)

    Dear mjassen,

    thanks for sharing this. Do you have any idea how I should go about a similar issue in the activity stream? I don’t want to hide the activities, but there’s a bug: https://wordpress.org/support/topic/activity-stream-links-project-to-user-not-group

    Thanks
    Leo

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to hide collabpress activity from the front end's recent comments area?’ is closed to new replies.