WordPress.org

Ready to get started?Download WordPress

Forums

Pods - Custom Content Types and Fields
[resolved] Bi-directional relationship field value retrieval (5 posts)

  1. Allprowebworks
    Member
    Posted 4 months ago #

    Bi-directional relationship fields based on posts do not report field values in the dashboard when one of the posts in the relationship is not published.

    Quick fix:
    add to pods/classes/Pods.php line 1127
    $params->params['where'] = 't.post_status IN ( "pending", "publish", "draft" )';

    Ideally, a filter would be used here. I'm not sure if this is a bug - other custom fields report their values in the dashboard even if the post status is not "publish", why should relationship fields be any different?

    https://wordpress.org/plugins/pods/

  2. Josh Pollock
    Member
    Plugin Author

    Posted 4 months ago #

    I can't find the line you are referring to, possibly you are referring to the wrong file. If I am understanding what you are asking for, I think a filter would be a welcome addition if one doesn't already exist. Can you please add a feature request and/or a pull request in our GitHub repo:

    https://github.com/pods-framework/pods

  3. Allprowebworks
    Member
    Posted 4 months ago #

    Thank you for the reply. See pull request.

  4. Josh Pollock
    Member
    Plugin Author

    Posted 4 months ago #

    Thank you for submitting the pull request. I left some comments and thoughts on it there. We will see what our lead developer Scott thinks of the idea.

  5. Allprowebworks
    Member
    Posted 4 months ago #

    Used pods_api_get_table_info_default_post_status filter.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.