BuddyPress Xprofile Custom Field Types: Posts Listing Error/Bug

  • Participant
    Adam Soucie on #25612

    While this may be related to my setup, I don’t think it is, so I wanted to mention it here…

    I’ve noticed that both the Custom Post Type and Custom Post Type Multiselect fields added by this plugin display ALL of the posts from a given CPT, instead of only the posts created by that user. I’m not sure this is intentional, but it is problematic for me as my users can now add posts from any user to their profile, instead of only the ones they’ve created themselves.

    Fortunately, I’ve found a simple fix. On line 88 of field-types/class-field-type-multi-select-post-type.php, I just added the following line:
    'author' => $args['user_id'], to restrict the posts displayed/selectable to just the user’s posts.

    Unfortunately, I had to create a custom version of the class in my theme to avoid future updates to the plugin wiping this out, so I’m hoping Brajesh can provide a better long-term solution to this issue 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #25626

    Hi Adam,
    Thank you for the topic.

    That was the intention to not limit the post types. Not all users will have written posts. So, that may be problematic.

    I can certainly add an option in upcoming releases. I have a release lined up for tomorrow, It may not be available in that, but the next one after that.

    Thank you

You must be logged in to reply to this topic.

This topic is: not resolved