WordPress.org

Ready to get started?Download WordPress

Forums

Role Scoper
[resolved] Comments are not displayed with custom post types (10 posts)

  1. boyvanamstel
    Member
    Posted 3 years ago #

    This is a Role Scoper issue.

    When using custom post types, Role Scoper causes comments to not show up, unless you're an admin.

    I traced back this issue to hardway/hardwa-front_rs.php line 62:
    $query = apply_filters('objects_request_rs', $query, 'post', '', array('skip_teaser' => true) );

    The parameters 'post' is the cause. Passing an empty string fixes the issue. Not sure what the side-effect are.

    http://wordpress.org/extend/plugins/role-scoper/

  2. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    That change you posted disables Recent Comments filtering, meaning the widget will include comments on posts the logged user can't read.

    I'm not seeing a problem with comment display for custom post types. Where are they missing on your installation? In the main "single post" area when viewing a post via its permalink? In the Recent Comments sidebar? In a posts index loop? In the results of a custom query you execute in template code?

  3. Gustave F. Gerhardt
    Member
    Posted 3 years ago #

    I too tried this solution. My wife has a blog at earth2mama.com, using one of ElegantThemes.com's custom themes. It uses all "custom post types", and the comments were showing only for the admin account. There is a members-only section, which is all I'm using Role Scoper for. I can't see anything else broken... but am leery something is amiss from utilizing this hack.

    Let me know if there is a better solution or if more information can help you troubleshoot. Thanks.

  4. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    After further investigation, the problem was in Role Scoper's interaction with GhostToast's custom taxonomies. Since they were defined as hierarchical and enabled for Role Scoper filtering, at least one term must be assigned to the post/note to keep it readable. This is arguably a bug, since no restrictions are defined for any custom taxonomy term. But the workaround is simply to remove from Roles > Options > Realm > "Taxonomy Usage" any hierarchical taxonomies which will not have a term consistently assigned.

    The other required change was in the template code that registered the post type. It required a third argument of 1 to force execution prior to Role Scoper initialization.

  5. boyvanamstel
    Member
    Posted 3 years ago #

    Thanks Kevin, for further investigating the issue.

    I'll try the workaround :).

  6. altert
    Member
    Posted 3 years ago #

    Hello, I'm experiencing the same problem as the original poster. I'm using Role Scoper
    1.3.41 and Custom Post Type UI 0.7 to create my custom posts. I've removed all taxonomies from Roles > Options > Realm > "Taxonomy Usage" but comments are still not visible. As far as I can see - the Custom Post Type UI plugin registers custom post types with priority 0.

  7. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    What exactly are you missing - Main comments listing under a post? Recent Comments widget or items? Comments metabox in post edit form? "Moderate Comments"?

  8. altert
    Member
    Posted 3 years ago #

    Sorry for not specifying it earlier - main comments listing under a post are missing.

  9. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    I'm not seeing this. Do you get the same results with the default theme? Have you customized capabilities for the CPT? If so, what are the settings?

  10. kevinB
    Member
    Plugin Author

    Posted 3 years ago #

    I confirmed the error reported by altert on Wp 3.2-RC2 (but not 3.1.3). The updated Role Scoper development code includes a fix.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic